mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	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:
		@@ -637,7 +637,7 @@ function protocol.make_client_capabilities()
 | 
				
			|||||||
        codeActionLiteralSupport = {
 | 
					        codeActionLiteralSupport = {
 | 
				
			||||||
          codeActionKind = {
 | 
					          codeActionKind = {
 | 
				
			||||||
            valueSet = (function()
 | 
					            valueSet = (function()
 | 
				
			||||||
              local res = vim.tbl_values(protocol.CodeActionKind)
 | 
					              local res = vim.tbl_values(constants.CodeActionKind)
 | 
				
			||||||
              table.sort(res)
 | 
					              table.sort(res)
 | 
				
			||||||
              return res
 | 
					              return res
 | 
				
			||||||
            end)(),
 | 
					            end)(),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user