Skip to content

Don't shrink the import path range again when cloning - #1868

Merged
TwitchBronBron merged 5 commits into
flatten-locationsfrom
import-clone-range
Oct 16, 2026
Merged

TwitchBronBron merged 5 commits into
flatten-locationsfrom
import-clone-range

Conversation

@TwitchBronBron

Copy link
Copy Markdown
Member

Stacked on #1845. The ImportStatement constructor narrows the path token's range to exclude the quotes, but a clone copies the already-narrowed token, so every clone lost another character on each side. The constructor now only narrows a token whose range still includes the quotes. This bug predates the location change.

Verified with npm run test:nocover (new test clones twice and checks the range).

🤖 Generated with Claude Code

TwitchBronBron and others added 2 commits October 2, 2026 16:13
The ImportStatement constructor narrows the path token's range to exclude the quotes. A clone copies the already-narrowed token, so the constructor narrowed it a second time. Only narrow a token whose range still includes the quotes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@TwitchBronBron
TwitchBronBron marked this pull request as ready for review October 16, 2026 14:12
@TwitchBronBron
TwitchBronBron merged commit defa02d into flatten-locations Oct 16, 2026
11 checks passed
@TwitchBronBron
TwitchBronBron deleted the import-clone-range branch October 16, 2026 14:28
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.

1 participant