Fix issue where we weren't properly adding elastic trivia to newly generated members#79571
Merged
CyrusNajmabadi merged 3 commits intodotnet:mainfrom Jul 24, 2025
Merged
Conversation
Contributor
Author
|
@jjonescz ptal. i can vouch for this, and this should fixup nearly all of the undesirable changes seen in your PR. Note: a small handful of changes will remain. But they represent appropriate differences. Specifically, when changing the modifiers of an existing construct, no line changes will happen now. |
CyrusNajmabadi
commented
Jul 24, 2025
| Accessibility accessibility, | ||
| DeclarationModifiers modifiers, | ||
| bool withLeadingElasticMarker = false) | ||
| bool withLeadingElasticMarker = true) |
Contributor
Author
There was a problem hiding this comment.
i have audited all usages of these private functions (so they're only called within this type). In almost all cases we ues this when making a new member. So we want the elastic marker so the new member is placed properly. In the few cases we are just updating a modifieer list, we now explicitly pass in 'false' there.
jjonescz
approved these changes
Jul 24, 2025
jjonescz
added a commit
to jjonescz/roslyn-analyzers
that referenced
this pull request
Jul 24, 2025
To bring in dotnet/roslyn#79571.
jjonescz
added a commit
to dotnet/roslyn-analyzers
that referenced
this pull request
Jul 25, 2025
* Handle extension members by 'make member static' * Suppress warning introduced by Roslyn bump * Suppress warning in test * Update tests * Update Roslyn To bring in dotnet/roslyn#79571. * Update Roslyn To bring in dotnet/roslyn#79576.
This was referenced Jul 29, 2025
ViktorHofer
pushed a commit
to dotnet/sdk
that referenced
this pull request
Aug 15, 2025
* Handle extension members by 'make member static' * Suppress warning introduced by Roslyn bump * Suppress warning in test * Update tests * Update Roslyn To bring in dotnet/roslyn#79571. * Update Roslyn To bring in dotnet/roslyn#79576.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found when updating roslyn-analyzers to latest version of roslyn.
Introduced with: #76054