refactor(language_server): implement Tool::shutdown trait method#15499
Conversation
Tool::shutdown trait methodTool::shutdown trait method
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. |
3910ffd to
c38b086
Compare
There was a problem hiding this comment.
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 theTooltrait with a newToolShutdownChangesreturn type - Implemented
shutdown()inServerLinterto return URIs requiring diagnostic clearing - Replaced
get_clear_diagnostics()inWorkspaceWorkerwith a newshutdown()method that also handles file watcher unregistration - Updated
Backend::shutdown()andBackend::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.
2956e66 to
2e22526
Compare
Merge activity
|
51a4b40 to
3fc0c4c
Compare
2e22526 to
232076b
Compare
3fc0c4c to
364ef4a
Compare
232076b to
77c5d30
Compare

No description provided.