Goto-definition on stale file can result in the wrong location
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
Sometimes VS Code fails to send a file update message for files on disk, e.g. when doing rebasing or similar with less integrated version control systems. In many cases the type signatures of the definitions haven't changed, but it's not uncommon for the location to have changed. If a goto-definition arrives at a file that has changed on disk we should probably:
1. Invalidate all the files. Since we do equality checking and cutoff, that isn't too expensive, just the disk IO.
2. Reparse that fail to find the precise location of the identifier we were going to, so at least in the common case we provide the right thing.
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.