-
Notifications
You must be signed in to change notification settings - Fork 289
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
Wrapped comments are missing the \\ prefix #1922
Comments
I verified the proposed change does fix it for file comments, but does not work for general comments in code. Here are some unit tests (added to LineWrappingTest). The second one passes with the suggested change but the first one does not because
|
Fixing it for within functions will be a much bigger job. Right now a CodeBlock has no idea that what you are adding is a comment after it is added. It is just adding text. To fix it would probably involve creating something like a CommentBlock that share some common functionality with CodeBlock and that is more work than I am signing up for. |
Though it might be possible to do it by adding no-arg placeholders to indicate the start of comments and one to indicate the end of comments. When it sees the start one it turns on trailingNewline and comment in the Codewriter and turns them off when it sees the end one |
I think it would be enough to fix this for comment-specific API only (like |
In my case i was only adding file comments, but in trying to submit a PR I was testing both cases |
Please feel free to submit separate PRs, or fix only a subset of the affected APIs! |
Describe the bug
When adding a comment that has long text that is long enough to wrap, additional lines are indented and do not have the \ at the beginning
To Reproduce
which produces this file comment:
Expected behavior
It should produce this file comment:
Additional context
I believe the issue are these 2 lines, which should probably be something more like this:
The text was updated successfully, but these errors were encountered: