-
-
Notifications
You must be signed in to change notification settings - Fork 737
perf(lsp): avoid one clone in code actions request #16543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this 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
Tooltrait'sget_code_actions_or_commandsmethod signature to acceptOption<&Vec<CodeActionKind>>instead ofOption<Vec<CodeActionKind>>to avoid cloning - Changed
LSPFileSystem::setto accept ownedUriinstead of borrowed&Urito eliminate intermediate clones at call sites - Removed unnecessary
Clonederives fromCapabilitiesandWorkspaceOptionstructs
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.
580942b to
316ef44
Compare
7f26e80 to
780ce15
Compare
780ce15 to
6157388
Compare
6157388 to
c8cc4b4
Compare
c8cc4b4 to
bacd9e8
Compare
bacd9e8 to
36380b0
Compare
36380b0 to
f3ec92d
Compare
028a337 to
f669d4a
Compare
f3ec92d to
36aa756
Compare
Merge activity
|
36aa756 to
5eb8b14
Compare

No description provided.