Skip to content

Fix prepareRename placeholders for quoted and computed properties - #65456

Open
Rafael Molina (rafamolina1) wants to merge 1 commit into
microsoft:mainfrom
rafamolina1:fix/65444-rename-placeholder
Open

Rafael Molina (rafamolina1) wants to merge 1 commit into
microsoft:mainfrom
rafamolina1:fix/65444-rename-placeholder

Conversation

@rafamolina1

Copy link
Copy Markdown

Fixes #65444.

Preparing a rename on obj.b or obj.c currently 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:

  • Confirmed the new regression tests fail against the original implementation using a Go overlay, without changing repository files.
  • Passed 24 selected Fourslash tests covering the new cases, content mappers, import paths, default imports/exports, private fields, numeric properties, and computed templates.
  • Tests ran with GOMAXPROCS=2, -p=1, and -parallel=1 to limit resource use.
  • gofmt -d is clean for both changed files, and git diff --check passes.
  • The full test suite, repository-wide lint, and repository-wide format checks were not run.

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.

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.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 18:30
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 12, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

7.0 regression: prepareRename placeholder includes quotes and brackets

2 participants