refactor(language_server): move get_code_actions_or_commands to Tool trait#15490
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. |
75c0959 to
bef4ce9
Compare
Merge activity
|
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the get_code_actions_or_commands method by moving it from a ServerLinter-specific implementation to the Tool trait, making it available for polymorphic use across different tool types (linter, formatter, etc.).
- Adds
get_code_actions_or_commandsas a trait method in theTooltrait with a default implementation - Moves the ServerLinter's existing implementation from the
impl ServerLinterblock to theimpl Tool for ServerLinterblock - Updates imports in tester.rs to include the
Tooltrait
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_language_server/src/tool.rs | Adds new trait method get_code_actions_or_commands with default implementation and required type imports |
| crates/oxc_language_server/src/linter/tester.rs | Adds Tool trait import to support trait method usage |
| crates/oxc_language_server/src/linter/server_linter.rs | Moves get_code_actions_or_commands from impl block to trait implementation without logic changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bef4ce9 to
79e6842
Compare

No description provided.