Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: (LSP) only add cached files relevant to workspace (#5775)
# Description ## Problem Resolves #5774 ## Summary LSP caches open files so that features work relative to open, potentially unsaved, file buffers. Before analyzing a crate or processing a package, we add these open files to a FileManager. The problem was that we were adding all open files, regardless of whether they belonged to a package. Because we don't always call `check_crate` on LSP features (for example when you hover we collect a packages files but don't call `check_crate`) a packages file FileIDs would change if we added new files that didn't exist before in that package. It's... kind of hard to explain. But it also makes sense to not add files that are not relevant to the package. I debugged it for hours until I found the reason. With this fix LSP should work really well now (it wasn't working that well in Aztec-Packages). ## Additional Context None. ## Documentation Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information