fix(61258): Renaming namespace with const enum doesn't update enum references#61263
Merged
jakebailey merged 1 commit intomicrosoft:mainfrom Apr 24, 2025
Merged
fix(61258): Renaming namespace with const enum doesn't update enum references#61263jakebailey merged 1 commit intomicrosoft:mainfrom
jakebailey merged 1 commit intomicrosoft:mainfrom
Conversation
jakebailey
reviewed
Feb 24, 2025
Member
|
I finally went to check this, and I think there's a simpler solution here; in rename, const searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : SemanticMeaning.All;The upshot of this is that what gets renamed for this symbol is filtered by the meaning, even if the symbols are the same. I think that doing this (undoing everything else in the PR) works: const searchMeaning = node && options.use !== FindReferencesUse.Rename ? getIntersectingMeaningFromDeclarations(node, symbol) : SemanticMeaning.All;Basically, in renames, find all references regardless of meaning. This works for the test case you added, but does also change one existing baseline in a way that I think is positive? Or at least, more consistent to my eye. |
jakebailey
reviewed
Apr 24, 2025
tests/baselines/reference/findAllRefs_importType_exportEquals.baseline.jsonc
Show resolved
Hide resolved
jakebailey
approved these changes
Apr 24, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #61258