Skip to content

refactor(language_server): move get_code_actions_or_commands to Tool trait#15490

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-08-refactor_language_server_move_get_code_actions_or_commands_to_tool_trait
Nov 8, 2025
Merged

refactor(language_server): move get_code_actions_or_commands to Tool trait#15490
graphite-app[bot] merged 1 commit intomainfrom
11-08-refactor_language_server_move_get_code_actions_or_commands_to_tool_trait

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Nov 8, 2025

No description provided.

@github-actions github-actions bot added A-editor Area - Editor and Language Server C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Nov 8, 2025
Copy link
Member Author

Sysix commented Nov 8, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@Sysix Sysix force-pushed the 11-08-refactor_language_server_move_get_code_actions_or_commands_to_tool_trait branch from 75c0959 to bef4ce9 Compare November 8, 2025 15:30
@Sysix Sysix marked this pull request as ready for review November 8, 2025 15:31
@Sysix Sysix requested a review from camc314 as a code owner November 8, 2025 15:31
Copilot AI review requested due to automatic review settings November 8, 2025 15:31
@Sysix Sysix added the 0-merge Merge with Graphite Merge Queue label Nov 8, 2025
Copy link
Member Author

Sysix commented Nov 8, 2025

Merge activity

Copy link
Contributor

Copilot AI left a 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 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_commands as a trait method in the Tool trait with a default implementation
  • Moves the ServerLinter's existing implementation from the impl ServerLinter block to the impl Tool for ServerLinter block
  • Updates imports in tester.rs to include the Tool trait

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.

@graphite-app graphite-app bot force-pushed the 11-08-refactor_language_server_move_get_code_actions_or_commands_to_tool_trait branch from bef4ce9 to 79e6842 Compare November 8, 2025 15:35
@graphite-app graphite-app bot merged commit 79e6842 into main Nov 8, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 11-08-refactor_language_server_move_get_code_actions_or_commands_to_tool_trait branch November 8, 2025 15:40
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants