Repository navigation
Fix prepareRename placeholders for quoted and computed properties - #65456
Open
Rafael Molina (rafamolina1) wants to merge 1 commit into
Open
Rafael Molina (rafamolina1) wants to merge 1 commit into
Rafael Molina (rafamolina1) wants to merge 1 commit into
Conversation
Use the name at the rename location instead of the formatted symbol declaration so quotes and brackets do not appear in rename placeholders. Preserve import-path handling and trigger ranges. Add regression coverage for literals, private identifiers, aliases, escaped and Unicode names, and resulting rename edits. Verified the regression against the original implementation and passed 24 selected Fourslash tests.
This branch has not been deployed
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 #65444.
Preparing a rename on
obj.borobj.ccurrently uses the formatted declaration name, producing placeholders such as'b'or['c']. Accepting those delimiters as part of a new name can produce invalid TypeScript.Use the name of the node at the rename location for identifiers and literals. Preserve the existing trigger range, import-path handling, and fallback for other eligible nodes.
Add Fourslash coverage for quoted and computed properties, templates, numeric properties, private identifiers, import aliases, named default exports, escaped names, and supplementary Unicode characters. Verify the resulting edits for quoted and computed properties. Subtests run sequentially.
Validation:
GOMAXPROCS=2,-p=1, and-parallel=1to limit resource use.gofmt -dis clean for both changed files, andgit diff --checkpasses.The linked issue is not currently assigned to the Backlog milestone; maintainer triage is pending.
AI assistance: This change and its tests were authored with OpenAI Codex assistance.