Skip to content
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

Use textDocument/codeLens data in the actions menu when applicable #2 #26848

Merged
merged 2 commits into from
Mar 15, 2025

Conversation

SomeoneToIgnore
Copy link
Contributor

Re-applies what's been reverted in #26832 with an action-related fix in 64b5d37

Before, actions were resolved only if data is present and either of the possible fields is empty:

&& lsp_action.data.is_some()
&& (lsp_action.command.is_none() || lsp_action.edit.is_none())

But Zed resolves completions and inlays once, unconditionally, and the reverted PR applied the same strategy to actions.
That did not work despite the spec not forbidding data-less actions to be resolved.

Soon, it starts to work due to rust-lang/rust-analyzer#19369 but it seems safer to restore the original filtering code.

Code lens have no issues with data-less resolves:
https://github.com/rust-lang/rust-analyzer/blob/220d913cbcd05f9b7635179a98c685f31821a572/crates/rust-analyzer/src/handlers/request.rs#L1618-L1620

so the same approach as completions and inlays is kept: resolve once.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 15, 2025
@SomeoneToIgnore SomeoneToIgnore enabled auto-merge (squash) March 15, 2025 19:57
@SomeoneToIgnore SomeoneToIgnore merged commit 8a31dca into main Mar 15, 2025
15 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the kb/resolve-actions-once-2 branch March 15, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant