diff options
Diffstat (limited to 'runtime/lua/vim/lsp/protocol.lua')
-rw-r--r-- | runtime/lua/vim/lsp/protocol.lua | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 218424fa14..3e111c154a 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -34,6 +34,13 @@ local constants = { Hint = 4; }; + DiagnosticTag = { + -- Unused or unnecessary code + Unnecessary = 1; + -- Deprecated or obsolete code + Deprecated = 2; + }; + MessageType = { -- An error message. Error = 1; @@ -292,8 +299,9 @@ local constants = { } for k, v in pairs(constants) do - vim.tbl_add_reverse_lookup(v) - protocol[k] = v + local tbl = vim.deepcopy(v) + vim.tbl_add_reverse_lookup(tbl) + protocol[k] = tbl end --[=[ @@ -520,6 +528,13 @@ export interface TextDocumentClientCapabilities { publishDiagnostics?: { --Whether the clients accepts diagnostics with related information. relatedInformation?: boolean; + --Client supports the tag property to provide meta data about a diagnostic. + --Clients supporting tags have to handle unknown tags gracefully. + --Since 3.15.0 + tagSupport?: { + --The tags supported by this client + valueSet: DiagnosticTag[]; + }; }; --Capabilities specific to `textDocument/foldingRange` requests. -- @@ -623,7 +638,11 @@ function protocol.make_client_capabilities() codeActionLiteralSupport = { codeActionKind = { - valueSet = vim.tbl_values(protocol.CodeActionKind); + valueSet = (function() + local res = vim.tbl_values(protocol.CodeActionKind) + table.sort(res) + return res + end)(); }; }; }; @@ -643,7 +662,7 @@ function protocol.make_client_capabilities() completionItemKind = { valueSet = (function() local res = {} - for k in pairs(protocol.CompletionItemKind) do + for k in ipairs(protocol.CompletionItemKind) do if type(k) == 'number' then table.insert(res, k) end end return res @@ -689,7 +708,7 @@ function protocol.make_client_capabilities() symbolKind = { valueSet = (function() local res = {} - for k in pairs(protocol.SymbolKind) do + for k in ipairs(protocol.SymbolKind) do if type(k) == 'number' then table.insert(res, k) end end return res @@ -701,6 +720,18 @@ function protocol.make_client_capabilities() dynamicRegistration = false; prepareSupport = true; }; + publishDiagnostics = { + relatedInformation = true; + tagSupport = { + valueSet = (function() + local res = {} + for k in ipairs(protocol.DiagnosticTag) do + if type(k) == 'number' then table.insert(res, k) end + end + return res + end)(); + }; + }; }; workspace = { symbol = { @@ -708,7 +739,7 @@ function protocol.make_client_capabilities() symbolKind = { valueSet = (function() local res = {} - for k in pairs(protocol.SymbolKind) do + for k in ipairs(protocol.SymbolKind) do if type(k) == 'number' then table.insert(res, k) end end return res @@ -723,6 +754,17 @@ function protocol.make_client_capabilities() dynamicRegistration = false; }; experimental = nil; + window = { + workDoneProgress = true; + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false; + }; + }; + showDocument = { + support = false; + }; + }; } end |