Skip to content

Comments

refactor(language_server): implement Tool::shutdown trait method#15499

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

refactor(language_server): implement Tool::shutdown trait method#15499
graphite-app[bot] merged 1 commit intomainfrom
11-08-reactor_language_server_implement_tool_shutdown_trait_method

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Nov 8, 2025

No description provided.

@Sysix Sysix changed the title reactor(language_server): implement Tool::shutdown trait method refactor(language_server): implement Tool::shutdown trait method Nov 8, 2025
@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-reactor_language_server_implement_tool_shutdown_trait_method branch 2 times, most recently from 3910ffd to c38b086 Compare November 8, 2025 18:19
@Sysix Sysix requested a review from Copilot November 8, 2025 19:35
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 diagnostics clearing mechanism during shutdown by introducing a new shutdown method to the Tool trait. The changes centralize shutdown logic at the tool level, making the cleanup process more consistent and maintainable.

Key changes:

  • Added shutdown() method to the Tool trait with a new ToolShutdownChanges return type
  • Implemented shutdown() in ServerLinter to return URIs requiring diagnostic clearing
  • Replaced get_clear_diagnostics() in WorkspaceWorker with a new shutdown() method that also handles file watcher unregistration
  • Updated Backend::shutdown() and Backend::did_change_workspace_folders() to use the new shutdown mechanism

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
crates/oxc_language_server/src/tool.rs Adds shutdown() method to Tool trait and defines ToolShutdownChanges struct for returning shutdown-related changes
crates/oxc_language_server/src/linter/server_linter.rs Implements shutdown() for ServerLinter and changes get_cached_files_of_diagnostics() visibility to private
crates/oxc_language_server/src/worker.rs Replaces get_clear_diagnostics() with shutdown() method that returns both URIs and unregistrations
crates/oxc_language_server/src/backend.rs Updates shutdown and workspace folder change handlers to use new shutdown mechanism and refactors clear_all_diagnostics() to clear_diagnostics()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sysix Sysix force-pushed the 11-08-reactor_language_server_implement_tool_shutdown_trait_method branch 2 times, most recently from 2956e66 to 2e22526 Compare November 8, 2025 19:44
@Sysix Sysix marked this pull request as ready for review November 8, 2025 19:47
@Sysix Sysix requested a review from camc314 as a code owner November 8, 2025 19:47
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Nov 9, 2025
Copy link
Contributor

camc314 commented Nov 9, 2025

Merge activity

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 9, 2025
@Sysix Sysix force-pushed the 11-08-refactor_language_server_move_llinter_formatter_methods_to_tool_trait branch from 51a4b40 to 3fc0c4c Compare November 9, 2025 00:36
@Sysix Sysix force-pushed the 11-08-reactor_language_server_implement_tool_shutdown_trait_method branch from 2e22526 to 232076b Compare November 9, 2025 00:36
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Nov 9, 2025
@graphite-app graphite-app bot force-pushed the 11-08-refactor_language_server_move_llinter_formatter_methods_to_tool_trait branch from 3fc0c4c to 364ef4a Compare November 9, 2025 00:41
@graphite-app graphite-app bot force-pushed the 11-08-reactor_language_server_implement_tool_shutdown_trait_method branch from 232076b to 77c5d30 Compare November 9, 2025 00:42
Base automatically changed from 11-08-refactor_language_server_move_llinter_formatter_methods_to_tool_trait to main November 9, 2025 00:46
@graphite-app graphite-app bot merged commit 77c5d30 into main Nov 9, 2025
22 checks passed
@graphite-app graphite-app bot deleted the 11-08-reactor_language_server_implement_tool_shutdown_trait_method branch November 9, 2025 00:46
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 9, 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