Use elastic crlf where applicable#25929
Conversation
|
Have you also checked references of |
|
Yes, it is not used. |
|
This needs @dotnet/roslyn-compiler review as we're touching the compiler layer. Also @mattwar for feedback. This will need tests of appropriate systems. |
|
The first commit in the PR is the one that fixes the github bug I reported. The others are code actions which are not marked with |
|
I have removed the elastic crlf change in SyntaxNodeRemover. It was an oversight when adding changes to the commit, elastic markers are added post-fact. |
|
There no longer is any compiler change in this PR, so I removed Compiler tag. Thanks |
|
Added another commit to fix unit tests. It seems like they add another newline now. |
There was a problem hiding this comment.
This is different behaviour from C#. declarationStatement does not have this check.
There was a problem hiding this comment.
As in, this probably causes the eol changes.
There was a problem hiding this comment.
FWIW, the EOL changes are welcome IMO. The whole point of elastic trivia formatting was precisely for these cases.
|
@Therzok @DustinCampbell To confirm, we're not taking this in 15.7? If so, we'll need to change the PR target. |
|
Sure. I'll retarget |
|
Which branch should I target this PR to? |
Document is formatted as part of the code fix
DustinCampbell
left a comment
There was a problem hiding this comment.
The change looks good to me. However, the integration tests need to be looked at. I expect many of them are failing because fixes/refactorings are now inserting line breaks where they didn't before.
DustinCampbell
left a comment
There was a problem hiding this comment.
The change looks good to me. However, the integration tests need to be looked at. I expect many of them are failing because fixes/refactorings are now inserting line breaks where they didn't before.
|
Yeah, I rebased in order to get a new build. I had fixed the previous ones before having to retarget. I'll fix asap |
|
Aren't the test failures related to #27048 ? |
|
Yes, I can confirm that the tests are failing because of the ongoing issue in #27048 |
|
Ping - the new tests have completed. However, I have identified that
Are failing across multiple PR's are probably flaky/broken |
|
@DustinCampbell anything else needed? |
There was a problem hiding this comment.
FWIW, the EOL changes are welcome IMO. The whole point of elastic trivia formatting was precisely for these cases.
|
Approved to merge for 15.8.Preview3 |
The changes switch End of Line trivia to use Elastic on code paths which end up being formatted by code actions or explicit elastic annotation formatting
Details
### Customer scenarioSee repro in #25927
Bugs this fixes
#25927
Workarounds, if any
Reformat the piece of code
Risk
?
Performance impact
Only modified the crlf trivia in case of code going into code actions. That triggers elastic trivia formatting, even if the code itself is not marked to format via annotation.
Is this a regression from a previous update?
Root cause analysis
I'm not sure how to add tests for this.
How was the bug found?
Found via ad-hoc testing in vsmac.