refactor(language_server): move tools definitions to Backend#15563
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. |
dbf139d to
6fef53d
Compare
0aecf04 to
57f4b63
Compare
fde861f to
5821976
Compare
5821976 to
f2eef3a
Compare
57f4b63 to
b440960
Compare
b440960 to
70b6c56
Compare
f2eef3a to
609101a
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the language server architecture by moving tool definitions (linter and formatter) from individual workers to the Backend. The ToolBuilder trait is redesigned to use a method that returns boxed trait objects, and builder structs are simplified to stateless types.
- Redesigned
ToolBuildertrait with abuild_boxedmethod that takes parameters by reference - Simplified
ServerLinterBuilderandServerFormatterBuilderto stateless structs with static-likebuildmethods - Centralized tool builder instantiation in
Backend::new()and passed them to workers during initialization
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_language_server/src/tool.rs | Simplified ToolBuilder trait to return boxed trait objects with references |
| crates/oxc_language_server/src/linter/server_linter.rs | Refactored ServerLinterBuilder to a stateless struct with separate build and build_boxed methods |
| crates/oxc_language_server/src/formatter/server_formatter.rs | Refactored ServerFormatterBuilder to a stateless struct with separate build and build_boxed methods |
| crates/oxc_language_server/src/backend.rs | Added tool_builders field and centralized tool builder instantiation |
| crates/oxc_language_server/src/worker.rs | Updated start_worker to accept tool builders as parameters |
| crates/oxc_language_server/src/linter/tester.rs | Updated test code to use new builder pattern |
| crates/oxc_language_server/src/formatter/tester.rs | Updated test code to use new builder pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
609101a to
0f0f260
Compare
70b6c56 to
ad5dbc6
Compare
0f0f260 to
a8f4156
Compare
ad5dbc6 to
1c2c060
Compare
a8f4156 to
3b8fcdf
Compare
Merge activity
|
8a7718e to
e1382c3
Compare
3b8fcdf to
616fd34
Compare
> This PR refactors the language server architecture by moving tool definitions (linter and formatter) from individual workers to the Backend. The ToolBuilder trait is redesigned to use a method that returns boxed trait objects, and builder structs are simplified to stateless types. Now it should be easy to implement something like `Backend::new(vec![ServerLinterBuilder]);`
e1382c3 to
4f89e1a
Compare
616fd34 to
727adba
Compare

Now it should be easy to implement something like
Backend::new(vec![ServerLinterBuilder]);