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

SHRBTextStyler doesn't format comments on root AST node #5818

Closed
j-brant opened this issue Feb 29, 2020 · 0 comments · Fixed by #9083
Closed

SHRBTextStyler doesn't format comments on root AST node #5818

j-brant opened this issue Feb 29, 2020 · 0 comments · Fixed by #9083

Comments

@j-brant
Copy link
Contributor

j-brant commented Feb 29, 2020

Compare the formatting of the following two expressions in a playground: "comment"3 and "comment"3+4. The latter shows the comment formatted correctly and the former shows the comment without any formatting. The comments are formatted by the code in SHRBTextStyler>>visitNode: and SHRBTextStyler>>style:ast: directly calls the acceptVisitor: method on the AST node instead of calling #visitNode: on self. Method comments are handled specially by #visitMethodNode: so they always are formatted even though they are at the top level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants