Fix #26358: AbstractDocumentationCommentCommandHandler has hardcoded Windows line ending#27626
Conversation
…coded Windows line ending I used `\n` and `\r\n` in string instead `@""` because as far as I understand on Windows/CI code is checked out with `git config core.autocrlf` which means it modifies line endings...
a63d7a4 to
5508d1c
Compare
|
Hmm, looks like unit tests infrastructure just replace |
…t infrastructure assumption that all code is `\r\n`
|
@dotnet-bot retest windows_debug_vs-integration_prtest please |
|
@dotnet-bot retest windows_debug_vs-integration_prtest please |
| private string GetNewLine(SourceText text) | ||
| { | ||
| // return editorOptionsFactoryService.GetEditorOptions(text).GetNewLineCharacter(); | ||
| return "\r\n"; |
|
Approved to merge for 15.8.Preview4 |
|
Thanks @DavidKarlas for the fix! I worry there are plenty more of these hiding... |
|
@jasonmalinowski first step in finding them would be removing hacks like https://github.com/dotnet/roslyn/blob/master/src/EditorFeatures/TestUtilities/Extensions/XElementExtensions.cs#L12 and not using |
|
Well, at the time NormalizedValue wasn't a hack: VB XML literals follow the XML spec which state that they're linefeed only even on Windows machines -- hence that converts to what we expected at the time. That said, I'd be 100% for using the platform's line endings in tests, and then just enabling our tests on Linux/Mac runs. Thoughts? |
I used
\nand\r\nin string instead@""because as far as I understand on Windows/CI code is checked out withgit config core.autocrlfwhich means it modifies line endings...Customer scenario
If customer uses
\nfor line endings and has appropriate formatting setting set, every time documentation after///is inserted it inserted\r\nwrongly.Bugs this fixes
#26358
Workarounds, if any
None.
Risk
Fix is pretty small, so I would say it's unlikely to cause regressions.
Performance impact
I don't expect changes
Is this a regression from a previous update?
No.
Root cause analysis
There was commented code that would support thiis, so I would assume reason was just not caring about
\nscenario. Unit test is added.How was the bug found?
While integrating this command with VSfM.
Test documentation updated?
Unit tests should be sufficient.