Port: Don't assume rename text parses as IdentiferNameSyntax #3126
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.
Port of #3069 to stabilization
Two commits:
Don't assume rename text parses as IdentiferNameSyntax
Fixes #1031
In both the C# and VB RenameRewriterLanguageServices, we were assuming
the new rename text would parse as an IdentifierNameSyntax, but if the
rename text is invalid it could parse as anything. For example, if the
user tries to rename "A" to "A.B", then it will parse as a
QualifiedNameSyntax. We now accommodate these cases.
Improve handling of invalid rename text in Inline Rename
This contains two small rename fixes related to invalid rename text:
intersection of the tracked rename spans and buffer changes was a single
span. However, when the rename text is invalid, there can be many buffer
change spans that intersect a single tracked rename span, so we now use
the least bounding span of the resulting intersection. We maintain the
requirement that this bounding buffer change span intersect a single
tracked rename span.
Dashboard. This change adds the same truncation algorithm already
applied to the original symbol name (which reduces it to 15 characters
and appends a "..." if necessary).