From 8f31a730c0dd76180648ba3b7c94aa5d059432e5 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sun, 16 Oct 2022 23:24:39 +0100 Subject: 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 --- runtime/lua/vim/lsp/protocol.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 4034753322..7442c8f005 100644 --- 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)(), -- cgit