-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Comments get removed for method parameter with attribute #2585
Comments
Hey Stefan, |
@dawedawe I just tried to take a look, but it's a bit unclear to me if the problem is with it choosing the wrong node to attach the trivia or if it's because the trivia didn't get printed in If I look at this code:
I see the trivia node for Can you maybe give me any pointers in the right direction? |
Ok, I think I found the problem. It is in
When I add this the generated code contains the comment, but for whatever reason also an additional space. Maybe any idea why this happens? EDIT: This seems to be a general problem as the space also gets added for this code: Code
Result
|
Hello Stefan, thank you for looking into this problem! Much appreciated. You actually want the comment to be a part of The result after all this will still not be a 100% what you originally had.
The comments are printed outside the |
@nojaf thanks, I've created a pull request with those changes and some tests. I will also open an issue about the double whitespace between ", //", I know it's just stylistic but it looks wrong in my opinion. |
Issue created from fantomas-online
Code
Result
Problem description
If you have a type method with an attribute and a comment afterwards the comment gets removed. If you don't include an attribute the formatting does not remove the comment.
Extra information
Options
Fantomas main branch at 2022-10-14T16:59:37Z - 35f093c
Default Fantomas configuration
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered: