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

Handle Empty CodeActionKind #7753

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tsukkee
Copy link

@tsukkee tsukkee commented Mar 10, 2024

This PR makes sorbet-lsp supports Empty CodeActionKind.
spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionKind

For example, vim-lsp sends Empty CodeActionKind in only property of CodeActionContext.
code: https://github.com/prabirshrestha/vim-lsp/blob/3af8f3b38effc4a631a15bb283a4b701c251275d/autoload/lsp/ui/vim/code_action.vim#L55

Related slack thread: https://sorbet-ruby.slack.com/archives/CFT8Y4909/p1701997597443059

Motivation

Vim with vim-lsp users cannot use Sorbet's CodeAction because sorbet-lsp returns the following error message when vim-lsp requests CodeAction.

Unable to deserialize LSP request: Error deserializing JSON message: Invalid value for enum type `CodeActionKind`: 

This error message looks like truncated because the error is caused by an empty string (""), which represents Empty CodeActionKind.

Test plan

I am sorry but I don't have good idea to write code to check make_lsp_types.cc follows the spec.
I would like to have some advice to do that if I need to write test in this case.

@tsukkee tsukkee requested a review from a team as a code owner March 10, 2024 08:10
@tsukkee tsukkee requested review from froydnj and removed request for a team March 10, 2024 08:10
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.

None yet

1 participant