refactor(language_server): make tools inside WorkspaceWorker more generic#15505
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. |
5fc79d4 to
c254688
Compare
c5c8a8d to
4abc114
Compare
c254688 to
99ca5f3
Compare
4abc114 to
25d577e
Compare
99ca5f3 to
5af7f64
Compare
5af7f64 to
0df28ca
Compare
4c97e71 to
2eed4b7
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the language server to use a trait-based architecture, replacing individual server_linter and server_formatter fields with a unified Vec<Box<dyn Tool>> collection. This enables more flexible tool management and reduces code duplication.
Key changes:
- Modified
Tooltrait to be object-safe withSend + Syncbounds and added aname()method - Changed
ToolRestartChangesfrom a generic struct to useBox<dyn Tool>for dynamic dispatch - Refactored
WorkspaceWorkerto iterate over tools instead of handling each tool separately
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_language_server/src/tool.rs | Made Tool trait object-safe and changed ToolRestartChanges to use boxed trait objects |
| crates/oxc_language_server/src/worker.rs | Replaced separate tool fields with unified vector, refactored all methods to iterate over tools |
| crates/oxc_language_server/src/linter/server_linter.rs | Implemented name() method and updated return types to use boxed trait objects |
| crates/oxc_language_server/src/formatter/server_formatter.rs | Implemented name() method and updated return types to use boxed trait objects |
| crates/oxc_language_server/src/formatter/mod.rs | Removed ServerFormatter from public exports as it's no longer directly referenced |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2eed4b7 to
33b342d
Compare
33b342d to
1b72aac
Compare
54ff8d1 to
ccfd935
Compare
1b72aac to
9797e29
Compare
WorkspaceWorker more genericWorkspaceWorker more generic
70b6c56 to
ad5dbc6
Compare
c486039 to
de9fe05
Compare
de9fe05 to
f0f0063
Compare
ad5dbc6 to
1c2c060
Compare
Merge activity
|
1c2c060 to
8a7718e
Compare
f0f0063 to
7528db4
Compare
8a7718e to
e1382c3
Compare
e1382c3 to
4f89e1a
Compare

No description provided.