Fix annotation parsing in nested comment blocks #25
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.
I need to be able to document classes that are nested. Like in this example:
This works, except for all the annotation handling. Annotations don't get recognized and all land in the description. The reason for that is how indented comments get returned from
CDocParser.CommentExtractor. The snippet above would result in this output:{ "lines": [ "text", " ", " @example", " <div class=\"fade-in-xs-up\">", " <span>Test</span>", " </div>" ], "type": "line", "commentRange": { "start": 43, "end": 48 }, "context": {} }The
filterAndGroupfunction then filters and groups the lines and uses the following to detect annotations:This of course doesn't work, because some of the lines are indented.
This fix trims the comment lines to detect annotations, uses the trimmed lines when pushing into a new group and then keeps using the untrimmed line so intentional indentation doesn't get lost (ex. in @example source code).