Skip to content

fix(rename): handle variables in dynamic property selectors#174

Open
calebdw wants to merge 1 commit into
PHPantom-dev:mainfrom
calebdw:calebdw/push-tmorwosozptt
Open

fix(rename): handle variables in dynamic property selectors#174
calebdw wants to merge 1 commit into
PHPantom-dev:mainfrom
calebdw:calebdw/push-tmorwosozptt

Conversation

@calebdw

@calebdw calebdw commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Dynamic property selectors like $message->{$attribute} were only partially walked. The scope collector skipped selector expressions when tracking local variable reads, which caused false unused_variable diagnostics for the selector variable.

The symbol map extractor also ignored non-identifier property selectors, so find-references and rename missed variable occurrences inside dynamic property accesses. Renaming $attribute updated plain variable uses but not the selector inside $message->{$attribute}.

Walk selector expressions during scope collection and emit variable symbol spans for dynamic property selectors in the symbol map. Add regression tests covering unused-variable diagnostics, references, and rename behavior for this pattern.

Dynamic property selectors like `$message->{$attribute}` were only partially
walked. The scope collector skipped selector expressions when tracking local
variable reads, which caused false `unused_variable` diagnostics for the
selector variable.

The symbol map extractor also ignored non-identifier property selectors, so
find-references and rename missed variable occurrences inside dynamic property
accesses. Renaming `$attribute` updated plain variable uses but not the
selector inside `$message->{$attribute}`.

Walk selector expressions during scope collection and emit variable symbol
spans for dynamic property selectors in the symbol map. Add regression tests
covering unused-variable diagnostics, references, and rename behavior for this
pattern.
@calebdw calebdw force-pushed the calebdw/push-tmorwosozptt branch from 8ad94da to 2d89408 Compare June 26, 2026 21:42
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 73.95833% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/scope_collector/mod.rs 30.00% 14 Missing ⚠️
src/symbol_map/extraction.rs 83.07% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants