Skip to content

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Dec 5, 2025

No description provided.

Copy link
Member Author

Sysix commented Dec 5, 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.

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 aims to improve performance by eliminating unnecessary clones in the language server implementation, building on previous optimization work. The changes focus on adjusting method signatures to accept borrowed references instead of owned values where cloning isn't necessary.

Key Changes:

  • Modified the Tool trait's get_code_actions_or_commands method signature to accept Option<&Vec<CodeActionKind>> instead of Option<Vec<CodeActionKind>> to avoid cloning
  • Changed LSPFileSystem::set to accept owned Uri instead of borrowed &Uri to eliminate intermediate clones at call sites
  • Removed unnecessary Clone derives from Capabilities and WorkspaceOption structs

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/oxc_language_server/src/tool.rs Updated trait method signature to accept borrowed reference instead of owned value
crates/oxc_language_server/src/worker.rs Adjusted call site to use .as_ref() and updated test code to pass owned values directly
crates/oxc_language_server/src/tests.rs Updated trait implementation to match new signature
crates/oxc_language_server/src/options.rs Removed unnecessary Clone derive from WorkspaceOption
crates/oxc_language_server/src/linter/server_linter.rs Updated trait implementation to match new signature
crates/oxc_language_server/src/file_system.rs Changed method signature to accept owned Uri to avoid clone inside the method
crates/oxc_language_server/src/capabilities.rs Removed unnecessary Clone derive from Capabilities
crates/oxc_language_server/src/backend.rs Refactored to reduce clones, but contains a critical iterator consumption bug in the options handling loop

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

@camc314 camc314 self-assigned this Dec 5, 2025
@graphite-app graphite-app bot changed the base branch from 12-05-perf_lsp_avoid_some_clones to graphite-base/16543 December 5, 2025 13:51
@graphite-app graphite-app bot force-pushed the graphite-base/16543 branch from 580942b to 316ef44 Compare December 5, 2025 13:55
@graphite-app graphite-app bot force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from 7f26e80 to 780ce15 Compare December 5, 2025 13:55
@graphite-app graphite-app bot changed the base branch from graphite-base/16543 to main December 5, 2025 13:56
@graphite-app graphite-app bot force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from 780ce15 to 6157388 Compare December 5, 2025 13:56
@graphite-app graphite-app bot changed the base branch from main to graphite-base/16543 December 5, 2025 14:06
@graphite-app graphite-app bot force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from 6157388 to c8cc4b4 Compare December 5, 2025 14:11
@graphite-app graphite-app bot changed the base branch from graphite-base/16543 to main December 5, 2025 14:11
@graphite-app graphite-app bot force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from c8cc4b4 to bacd9e8 Compare December 5, 2025 14:11
@Sysix Sysix changed the base branch from main to graphite-base/16543 December 8, 2025 17:58
@Sysix Sysix force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from bacd9e8 to 36380b0 Compare December 8, 2025 17:58
@Sysix Sysix changed the base branch from graphite-base/16543 to 12-08-test_lsp_add_test_for_initialize_request_with_multiple_workspace_folders_options December 8, 2025 17:58
@Sysix Sysix changed the title perf(lsp): avoid some clones, part 2 perf(lsp): avoid one clone in code actions request Dec 8, 2025
@Sysix Sysix marked this pull request as ready for review December 8, 2025 18:00
@Sysix Sysix requested a review from camc314 as a code owner December 8, 2025 18:00
@graphite-app graphite-app bot changed the base branch from 12-08-test_lsp_add_test_for_initialize_request_with_multiple_workspace_folders_options to graphite-base/16543 December 8, 2025 18:04
@graphite-app graphite-app bot force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from 36380b0 to f3ec92d Compare December 8, 2025 18:09
@graphite-app graphite-app bot force-pushed the graphite-base/16543 branch from 028a337 to f669d4a Compare December 8, 2025 18:09
@graphite-app graphite-app bot changed the base branch from graphite-base/16543 to main December 8, 2025 18:09
@graphite-app graphite-app bot force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from f3ec92d to 36aa756 Compare December 8, 2025 18:10
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 8, 2025
Copy link
Contributor

camc314 commented Dec 8, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 12-05-perf_lsp_avoid_some_clones_part_2 branch from 36aa756 to 5eb8b14 Compare December 8, 2025 22:55
@graphite-app graphite-app bot merged commit 5eb8b14 into main Dec 8, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 12-05-perf_lsp_avoid_some_clones_part_2 branch December 8, 2025 23:00
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 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-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants