-
-
Notifications
You must be signed in to change notification settings - Fork 734
fix(oxlint/lsp): revalidate all known files after internal restart #16407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(oxlint/lsp): revalidate all known files after internal restart #16407
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modifies the language server to revalidate only files currently open in the editor when internal tool restarts occur (such as configuration changes or config file updates), rather than revalidating all files that have previously been linted.
Key changes:
- Thread
LSPFileSystemparameter through tool restart methods to access currently open files - Replace cached diagnostics file list with file system keys for revalidation
- Remove file system entry removal on file save
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/oxc_language_server/src/worker.rs |
Added file_system parameter to did_change_watched_files and did_change_configuration methods; updated test calls to pass LSPFileSystem::default() |
crates/oxc_language_server/src/tool.rs |
Added file_system: &LSPFileSystem parameter to handle_configuration_change and handle_watched_file_change trait methods |
crates/oxc_language_server/src/tests.rs |
Updated FakeTool implementation to accept new file_system parameter |
crates/oxc_language_server/src/linter/tester.rs |
Updated test helper to pass LSPFileSystem::default() to configuration change method |
crates/oxc_language_server/src/linter/server_linter.rs |
Changed revalidation to use file_system.keys() instead of get_cached_files_of_diagnostics() to only revalidate open files |
crates/oxc_language_server/src/formatter/tester.rs |
Updated test helper to pass LSPFileSystem::default() to configuration change method |
crates/oxc_language_server/src/formatter/server_formatter.rs |
Added unused _file_system parameter to trait method implementations |
crates/oxc_language_server/src/backend.rs |
Passed file system reference to worker methods; removed file system entry removal on save |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
25cdca9 to
b2cfd78
Compare
b2cfd78 to
a377175
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
crates/oxc_language_server/src/backend.rs:511
- The removal of
self.file_system.write().await.remove(uri)from this method can cause stale in-memory content to be used during tool restarts.
If the server's save capability doesn't include includeText: true (meaning params.text will be None), the file is saved to disk but the old content remains in the in-memory file_system. When a tool restart occurs later, the code in worker.rs:312-320 will use this stale in-memory content instead of reading the saved version from disk.
The original behavior of removing the file from the in-memory file system on save ensures that subsequent operations (like tool restarts) will read the up-to-date content from disk. Unless there's a guarantee that params.text is always provided, this removal should be preserved.
let Some(worker) = workers.iter().find(|worker| worker.is_responsible_for_uri(uri)) else {
return;
};
if let Some(diagnostics) = worker.run_diagnostic_on_save(uri, params.text.as_deref()).await
{
self.client.publish_diagnostics(uri.clone(), diagnostics, None).await;
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a377175 to
5e95306
Compare
7fd08de to
f6a8a66
Compare
5e95306 to
ccc477c
Compare
Merge activity
|
ccc477c to
c5de638
Compare
f6a8a66 to
5dfde85
Compare
…16407) Before: Linted all files which are not ignored & supported After: Lint all files which are got open inside the editor
c5de638 to
0c14531
Compare

Before:
Linted all files which are not ignored & supported
After:
Lint all files which are got open inside the editor