-
-
Notifications
You must be signed in to change notification settings - Fork 719
refactor(language_server): move tools definitions to Backend
#15563
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
base: 11-08-refactor_language_server_make_tools_more_generic
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
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.
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 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
Now it should be easy to implement something like
Backend::new(vec![ServerLinterBuilder]);