refactor(language_server): improve file watching for different tools#14645
Merged
graphite-app[bot] merged 1 commit intomainfrom Oct 18, 2025
Conversation
This was referenced Oct 15, 2025
Member
Author
fb75940 to
61a7ade
Compare
55fd06f to
b4880dc
Compare
ae1f3d7 to
eb0a9e2
Compare
eb0a9e2 to
82cfd20
Compare
b4880dc to
65faf92
Compare
7e6b7af to
ea19c06
Compare
graphite-app bot
pushed a commit
that referenced
this pull request
Oct 17, 2025
…#14509) The server now sends a request to the client, to watch for `.oxfmtrc.json` or custom configurable `fmt.configPath` file content changes. The client will send a `workspace/didChangeWatchedFiles` notification to the server. The client can also send `workspace/didChangeConfiguration`, for now the server will restart both tools. This will be optimized by looking at which tool is responsible for the file in #14645
ea19c06 to
c4ce08f
Compare
65faf92 to
8b322d4
Compare
c4ce08f to
43b72c8
Compare
118fab8 to
011f186
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the file watching system in the language server to provide more granular control over different tools (linter and formatter) by implementing separate watch patterns and registration/unregistration mechanisms.
- Moves from a single workspace watcher to tool-specific watchers with unique IDs
- Implements individual registration and unregistration of file watchers
- Adds new methods to generate watch patterns for linter and formatter tools
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/oxc_language_server/src/worker.rs | Refactors watcher initialization and configuration changes to use tool-specific patterns and registrations |
| crates/oxc_language_server/src/linter/server_linter.rs | Adds methods to generate and compare watch patterns for linter configuration files |
| crates/oxc_language_server/src/formatter/server_formatter.rs | Adds methods to generate and compare watch patterns for formatter configuration files |
| crates/oxc_language_server/src/backend.rs | Updates configuration change handling to use new registration/unregistration system |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
59f8947 to
18626c3
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
18626c3 to
e07da87
Compare
e07da87 to
74ad10b
Compare
Contributor
Merge activity
|
…14645) Now the worker is responsible to provide the dynamic registration with `Registration` and `Unregistration`. The worker will use the provided tools to detect the needed watcher changes. Before this PR, the server/Backend created the `Registration` struct for each worker, this was not great because we needed to register the watchers for the other tools too. Now every tool has its own `Registration.id` which can be unregistered. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#client_registerCapability https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#client_unregisterCapability
74ad10b to
699c91c
Compare
This was referenced Oct 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Now the worker is responsible to provide the dynamic registration with
RegistrationandUnregistration.The worker will use the provided tools to detect the needed watcher changes.
Before this PR, the server/Backend created the
Registrationstruct for each worker, this was not great because we needed to register the watchers for the other tools too.Now every tool has its own
Registration.idwhich can be unregistered.https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#client_registerCapability
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#client_unregisterCapability