rescript-lang / rescript-lang/rescript-vscode
Rename happens in wrong location when build has failed
Nobody has claimed this yet.
- Dominant language
- ReScript
- Stars
- 354
- Forks
- 63
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 1
Description
It looks like the rename happens based on the last known location for a token. This means that if you create a syntax error in your script and try to rename something, the location of the tokens may be outdated and the new name is inserted in the wrong position.
Video is attached that shows this happening. The syntax error in this case is an unbalanced piece of JSX.
https://user-images.githubusercontent.com/327697/168043168-d86d788d-e31a-4f8f-900d-d4b248a0e040.mov
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in the VSCode plugin by introducing an unbalanced JSX fragment, causing a build failure, and then invoking rename as shown in the attached video. Trace the rename handling from that scenario and verify that the new name is inserted at the token's current location rather than its outdated location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100