project: Don't send context.only for generic code action requests#50979
Merged
SomeoneToIgnore merged 2 commits intozed-industries:mainfrom Mar 19, 2026
Merged
Conversation
Contributor
Author
|
You're welcome! |
AmaanBilwar
pushed a commit
to AmaanBilwar/zed
that referenced
this pull request
Mar 20, 2026
…d-industries#50979) Closes zed-industries#48917 ## Summary - Stop sending `context.only` for generic `textDocument/codeAction` requests. - Keep explicit kind filtered requests unchanged. - Add regression coverage for generic code action requests so actions like `source.addTest` remain visible. ## Root Cause `GetCodeActions::to_lsp` populated `context.only` even when the caller requested all code actions (`kinds == None`). That turned the normal code actions menu into a filtered request. With `gopls`, this filtered out `source.addTest`, so `Add test for ...` never appeared. ## Verification - `cargo fmt --all -- --check` - `./script/clippy -p project` - `cargo nextest run -p project --no-fail-fast --no-tests=warn` - `cargo test -p editor editor_tests::test_organize_imports_manual_trigger -- --exact` - `cargo test -p editor editor_tests::test_context_menus_hide_hover_popover -- --exact` ## Manual Testing - Repro'd the protocol level behavior against `gopls`: unfiltered requests return `source.addTest`, filtered requests excluding it do not. - Opened `zed_guild/testing_projects/act/pkg/artifactcache/handler.go` - Triggered `Show Code Actions` on `StartHandler` - Confirmed `Add test for StartHandler` appears Release Notes: - Fixed Go `gopls` code actions so `Add test for ...` appears in the generic code actions menu. Co-authored-by: Kirill Bulatov <kirill@zed.dev>
toshmukhamedov
pushed a commit
to toshmukhamedov/zed
that referenced
this pull request
Mar 20, 2026
…d-industries#50979) Closes zed-industries#48917 ## Summary - Stop sending `context.only` for generic `textDocument/codeAction` requests. - Keep explicit kind filtered requests unchanged. - Add regression coverage for generic code action requests so actions like `source.addTest` remain visible. ## Root Cause `GetCodeActions::to_lsp` populated `context.only` even when the caller requested all code actions (`kinds == None`). That turned the normal code actions menu into a filtered request. With `gopls`, this filtered out `source.addTest`, so `Add test for ...` never appeared. ## Verification - `cargo fmt --all -- --check` - `./script/clippy -p project` - `cargo nextest run -p project --no-fail-fast --no-tests=warn` - `cargo test -p editor editor_tests::test_organize_imports_manual_trigger -- --exact` - `cargo test -p editor editor_tests::test_context_menus_hide_hover_popover -- --exact` ## Manual Testing - Repro'd the protocol level behavior against `gopls`: unfiltered requests return `source.addTest`, filtered requests excluding it do not. - Opened `zed_guild/testing_projects/act/pkg/artifactcache/handler.go` - Triggered `Show Code Actions` on `StartHandler` - Confirmed `Add test for StartHandler` appears Release Notes: - Fixed Go `gopls` code actions so `Add test for ...` appears in the generic code actions menu. Co-authored-by: Kirill Bulatov <kirill@zed.dev>
AmaanBilwar
pushed a commit
to AmaanBilwar/zed
that referenced
this pull request
Mar 23, 2026
…d-industries#50979) Closes zed-industries#48917 ## Summary - Stop sending `context.only` for generic `textDocument/codeAction` requests. - Keep explicit kind filtered requests unchanged. - Add regression coverage for generic code action requests so actions like `source.addTest` remain visible. ## Root Cause `GetCodeActions::to_lsp` populated `context.only` even when the caller requested all code actions (`kinds == None`). That turned the normal code actions menu into a filtered request. With `gopls`, this filtered out `source.addTest`, so `Add test for ...` never appeared. ## Verification - `cargo fmt --all -- --check` - `./script/clippy -p project` - `cargo nextest run -p project --no-fail-fast --no-tests=warn` - `cargo test -p editor editor_tests::test_organize_imports_manual_trigger -- --exact` - `cargo test -p editor editor_tests::test_context_menus_hide_hover_popover -- --exact` ## Manual Testing - Repro'd the protocol level behavior against `gopls`: unfiltered requests return `source.addTest`, filtered requests excluding it do not. - Opened `zed_guild/testing_projects/act/pkg/artifactcache/handler.go` - Triggered `Show Code Actions` on `StartHandler` - Confirmed `Add test for StartHandler` appears Release Notes: - Fixed Go `gopls` code actions so `Add test for ...` appears in the generic code actions menu. Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48917
Summary
context.onlyfor generictextDocument/codeActionrequests.source.addTestremain visible.Root Cause
GetCodeActions::to_lsppopulatedcontext.onlyeven when the caller requested all code actions (kinds == None). That turned the normal code actions menu into a filtered request. Withgopls, this filtered outsource.addTest, soAdd test for ...never appeared.Verification
cargo fmt --all -- --check./script/clippy -p projectcargo nextest run -p project --no-fail-fast --no-tests=warncargo test -p editor editor_tests::test_organize_imports_manual_trigger -- --exactcargo test -p editor editor_tests::test_context_menus_hide_hover_popover -- --exactManual Testing
gopls: unfiltered requests returnsource.addTest, filtered requests excluding it do not.zed_guild/testing_projects/act/pkg/artifactcache/handler.goShow Code ActionsonStartHandlerAdd test for StartHandlerappearsRelease Notes:
goplscode actions soAdd test for ...appears in the generic code actions menu.