commit 8f31a730c0dd76180648ba3b7c94aa5d059432e5
parent 935e1ca743abb4fce1effef063e5645f3df88119
Author: David Hotham <david.hotham@blueyonder.co.uk>
Date: Sun, 16 Oct 2022 23:24:39 +0100
fix(lsp): reporting bogus capabilities in CodeActionKind #20678
Problem:
LSP client provides bogus capabilities in CodeActionKind.
LSP logs show this in the "initialize" message:
codeActionKind = { valueSet = { "Empty", "QuickFix",
"Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite",
"Source", "SourceOrganizeImports", "", "quickfix", "refactor",
"refactor.extract", "refactor.inline", "refactor.rewrite", "source",
"source.organizeImports" }
Solution:
Only the values from the CodeActionKind table should be presented, not also the
keys.
fix #20657
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
@@ -637,7 +637,7 @@ function protocol.make_client_capabilities()
codeActionLiteralSupport = {
codeActionKind = {
valueSet = (function()
- local res = vim.tbl_values(protocol.CodeActionKind)
+ local res = vim.tbl_values(constants.CodeActionKind)
table.sort(res)
return res
end)(),