Skip to content

Fix rename from constant definition sites - #4176

Open
Guflly wants to merge 1 commit into
Shopify:mainfrom
Guflly:fix/constant-definition-rename
Open

Fix rename from constant definition sites#4176
Guflly wants to merge 1 commit into
Shopify:mainfrom
Guflly:fix/constant-definition-rename

Conversation

@Guflly

@Guflly Guflly commented Jul 27, 2026

Copy link
Copy Markdown

Motivation

Closes #4090.

Constant assignments and multi-assignment targets are valid rename origins, but they were excluded from both rename request node filters.

Implementation

Include ConstantWriteNode and ConstantTargetNode in rename lookup and constant name resolution. prepareRename uses name_loc for constant writes so the returned range covers only the name.

Automated Tests

Added coverage for preparing and applying renames from direct assignments and multi-assignment targets. The focused rename, prepare-rename, and index tests pass.

Manual Tests

Not run; the request behavior is covered by the automated tests.

@Guflly
Guflly marked this pull request as ready for review July 28, 2026 02:36
@Guflly
Guflly requested a review from a team as a code owner July 28, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prepareRename / rename returns nil at constant definition sites (ConstantWriteNode, ConstantTargetNode)

1 participant