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
This commit is contained in:
David Hotham 2022-10-16 23:24:39 +01:00 committed by GitHub
parent 935e1ca743
commit 8f31a730c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)(),