-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix issue with disappearing newlines after multiline documentation comment #77521
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
Changes from 3 commits
67cf301
88cea22
4c5889f
e23e582
aac7fa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3790,6 +3790,26 @@ void goo() | |
| "}"); | ||
| } | ||
|
|
||
| [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/76856")] | ||
| public void TestNormalizeDocumentationMultiLineCommentsWithTrailingNewline() | ||
| { | ||
| TestNormalizeStatement(""" | ||
| /** | ||
| * | ||
| * Escape XML special characters | ||
| */ | ||
| private String EscapeXML(String str) | ||
| { | ||
| """, """ | ||
| /// | ||
| /// | ||
| /// Escape XML special characters | ||
| ////// | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we generate so many slashes here?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought the same thing, but that generation is outside the scope of this request, imo. The current behavior has just as many slashes, but misses the newline after them so it ends up as
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly, I didn't modify the resulting slashes because I didn't know if that was the expected result from a normalization point of view. If the test instead had input of there would be 3 slashes only. If you think this should be fixed and padding should be ignored when replacing with slashes at comment end, let me know. I can pick this up as a follow-up improvement PR. |
||
| private String EscapeXML(String str) | ||
| { | ||
| """); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void TestNormalizeEOL() | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.