Skip to content

feat(lsp): show code action loading picker - #292

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/code-action-loading
Aug 21, 2026
Merged

fcoury-oai merged 2 commits into
mainfrom
fcoury/code-action-loading

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

Code actions currently feel unresponsive because their picker appears only after the language server returns a response. The default keymap also lacks the familiar Space c a shortcut.

What changed

  • Add Space c a for code actions while preserving Space . and the existing Space c c / Space c q Git shortcuts.
  • Open the code-action picker immediately with an animated loading indicator, then replace it with the available actions once the language server responds.
  • Track request ownership so cancellation, empty or stale results, unavailable servers, and request failures dismiss the loading picker safely; late responses cannot reopen a cancelled picker.
  • Add keymap, rendered-loading-state, successful-action, cancellation, empty-result, and error-path regression coverage.

How to Test

  1. Open a file with an active language server and place the cursor on a diagnostic with an available quick fix.
  2. Press Space c a and confirm the Code actions picker opens immediately with an animated loading indicator before the available fixes appear. Verify Space . still opens the same picker.
  3. Select a fix and confirm its workspace edit is applied. Also confirm Space c c and Space c q retain their existing Git actions.
  4. Request code actions again and press Esc before the response arrives; confirm the picker stays closed when the delayed response arrives. Repeat with no applicable actions or no language server and confirm the loading picker closes cleanly.
  5. Run cargo test -p red --lib code_action and cargo test -p red --test lsp_lazy; expect the focused code-action regressions and complete LSP integration suite to pass.

@fcoury-oai
fcoury-oai merged commit 7c9ba3a into main Aug 21, 2026
12 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/code-action-loading branch August 21, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant