refactor(lsp): accept only one Tool & ToolBuilder#20840
refactor(lsp): accept only one Tool & ToolBuilder#20840graphite-app[bot] merged 1 commit intomainfrom
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.
Pull request overview
Refactors the oxc_language_server LSP implementation to operate with a single Tool/ToolBuilder instead of managing multiple tools per workspace, simplifying worker creation and capability wiring.
Changes:
- Replaced tool/builder collections with single
tool+builderinWorkspaceWorkerandWorkerManager. - Updated
Backend/run_serverAPIs and call sites to pass a singleToolBuilder. - Adjusted LSP and worker tests to construct and pass a single
FakeToolBuilder.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_language_server/src/worker_manager.rs | Stores a single shared tool builder and passes it into new workers; updates tests accordingly. |
| crates/oxc_language_server/src/worker.rs | Switches from Vec<Tool> to a single optional tool and updates all tool interactions/shutdown/watchers. |
| crates/oxc_language_server/src/backend.rs | Uses the single tool builder to contribute server capabilities; Backend::new now accepts one builder. |
| crates/oxc_language_server/src/lib.rs | run_server signature updated to accept a single ToolBuilder. |
| crates/oxc_language_server/src/tests.rs | Updates integration-style tests to construct Backend with a single FakeToolBuilder. |
| apps/oxlint/src/lsp/mod.rs | Updates oxlint LSP entrypoint to pass one builder. |
| apps/oxfmt/src/lsp/mod.rs | Updates oxfmt LSP entrypoint to pass one builder. |
Comments suppressed due to low confidence (1)
crates/oxc_language_server/src/worker.rs:189
format_filestill has logic/comments that assume multiple tools (e.g. “continue to the next tool”), but the worker now holds only one tool. Simplifying this to a single-tool flow (and updating the comment accordingly) would reduce confusion and make the intent clearer.
for tool in self.tool.read().await.iter() {
let edits = tool.run_format(document)?;
// If no edits are made, continue to the next tool
if edits.is_empty() {
continue;
}
0278e72 to
58519df
Compare
Merge activity
|
> ## Pull request overview > > Refactors the `oxc_language_server` LSP implementation to operate with a single `Tool`/`ToolBuilder` instead of managing multiple tools per workspace, simplifying worker creation and capability wiring.
58519df to
58012db
Compare

Uh oh!
There was an error while loading. Please reload this page.