C# improvements#231
Open
romamihalich wants to merge 4 commits into
Open
Conversation
1. Fix "return" insertion for:
- method returning void (not insert if void)
- constructor (not insert at all)
- indexer (change logic from search for return statement to checking if getter is present, because get might not contain return statement, but instead "=>", also might not contain body at all in interfaces)
2. Fix parameter generation when attribute is attached to it
3. Added support for primary constructors
4. Added support for records, record structs, structs (same logic as classes)
5. Change parameters and type parameters order for xmldoc (type parameters should go first)
Author
|
Also "doxygen" is default annotation convention for C#. Most of C# devs use "xmldoc". Maybe it makes sense to set "xmldoc" as default? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found some issues in C# doc generation and decided to fix it.
Number 4. of changes list fixes #181.
Changes
1. Fix "returns" insertion
1.1 Method returning void
Not insert if void. Currently checks for first child in
ret.return_statement, but it's not enough, because modifiers likepublic,staticetc can be put before return type.before:
after:
1.2 Constructor
Not insert at all. Currently inserts every time.
before:
after:
1.3 Indexer
Change logic from search for return statement to checking if getter is present, because
getmight not contain return statement, but instead=>, also might not contain body at all in interfaces.before:
after:
2. Fix parameter generation when attribute is attached to it
Currently gets 2-nd position of children in parameter. Changed it to take last child instead.
before:
after:
3. Added support for primary constructors
before:
after:
4. Added support for records, record structs, structs
Same logic as for classes is applied.
5. Added enum support
6. Change parameters and type parameters order for xmldoc (type parameters should go first)
before:
after: