Repository navigation
Do not make unnecessarily simplification changes in sync-namespace. - #78969
Merged
Merged
Conversation
CyrusNajmabadi
commented
Jun 13, 2025
| } | ||
|
|
||
| protected override string EscapeIdentifier(string identifier) | ||
| => identifier.EscapeIdentifier(); |
CyrusNajmabadi
marked this pull request as ready for review
June 13, 2025 21:50
CyrusNajmabadi
commented
Jun 13, 2025
| public static class Extensions | ||
| { | ||
| public static bool Foo(this string s) => true; | ||
| public static bool Foo(this String s) => true; |
Contributor
Author
There was a problem hiding this comment.
desirable change in behavior. we were unnecessarily changing this here, despite it having nothing to do with the namespaces being changed.
JoeRobich
approved these changes
Jun 13, 2025
CyrusNajmabadi
commented
Jun 13, 2025
| public CSharpChangeNamespaceService() | ||
| { | ||
| } | ||
| public override AbstractReducer NameReducer { get; } = new CSharpNameReducer(); |
Contributor
Author
There was a problem hiding this comment.
general idea is htat we go find the locations of interest, and only simplify them with the language's name simplifier (not all the other simplifiers).
| return (solutionWithFixedReferences, refLocationGroups.SelectAsArray(g => g.Key)); | ||
| } | ||
|
|
||
| private readonly struct LocationForAffectedSymbol(ReferenceLocation location, bool isReferenceToExtensionMethod) |
Contributor
Author
There was a problem hiding this comment.
moved to its own file.
|
|
||
| return name.Parent is TCrefSyntax ? name.Parent : name; | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
crux of the change. we only go fixup names that were using one of hte namespace names in either the old namespace name, or the new namespace name.
| /// declaration in global namespace and there's no namespace declaration in this document. | ||
| /// (3) otherwise, null. | ||
| /// </returns> | ||
| protected abstract Task<SyntaxNode?> TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken); |
Contributor
Author
There was a problem hiding this comment.
moved up from bottom.
| /// </returns> | ||
| protected abstract Task<SyntaxNode?> TryGetApplicableInvocationNodeAsync(Document document, TextSpan span, CancellationToken cancellationToken); | ||
|
|
||
| protected abstract string EscapeIdentifier(string identifier); |
CyrusNajmabadi
enabled auto-merge
June 13, 2025 22:02
This was referenced Jun 18, 2025
This was referenced Jun 26, 2025
Closed
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.
Fixes #34707