Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End-of-line comments not available in summary #67

Open
henrikbarium opened this issue Feb 27, 2022 · 2 comments
Open

End-of-line comments not available in summary #67

henrikbarium opened this issue Feb 27, 2022 · 2 comments
Assignees
Labels
bug Something isn't working feedback waiting for feedback fixed

Comments

@henrikbarium
Copy link

If I run:

KotlinGrammarAntlrKotlinParser.parseKotlinFile(AstSource.String("source", "//line comment"))

The resulting raw AST contains the line comment (as expected). If I call summary() on that AST, the line comment is represented as a KlassComment (again, as expected).

Then, if I run:

KotlinGrammarAntlrKotlinParser.parseKotlinFile(AstSource.String("source", "val answer = 42 //line comment"))

Again, the resulting raw AST contains the line comment (as expected). However, if I call summary() on that AST I cannot find the comment anywhere.

Am I missing something or is this a limitation/bug in the library?

@drieks
Copy link
Collaborator

drieks commented Mar 3, 2022

Hi @henrikbarium, thank you for reporting, I will fix it.

drieks added a commit that referenced this issue Mar 4, 2022
@drieks drieks closed this as completed in c3dbed3 Mar 4, 2022
@drieks drieks self-assigned this Mar 4, 2022
@drieks drieks added bug Something isn't working feedback waiting for feedback fixed labels Mar 4, 2022
@drieks drieks reopened this Mar 4, 2022
@drieks
Copy link
Collaborator

drieks commented Mar 4, 2022

Hi @henrikbarium, should be working now. Some AST-Nodes were dropping "unrelated" AST-Nodes, but comments were handled as unrelated. I changed this "related" filter and added a new comment filter to keep all comment nodes.

Please try version 7a60784a13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback waiting for feedback fixed
Projects
None yet
Development

No branches or pull requests

2 participants