mirror of
https://github.com/neovim/neovim.git
synced 2025-12-07 07:02:46 +00:00
LSP: Add diagnostic tags to client capabilities (#13578)
pyright (possibly others) does not send any hint diagnostics if we do not have tagSupport in PublishDiagnosticsClientCapabilities. This PR just adds them.
This commit is contained in:
@@ -34,6 +34,13 @@ local constants = {
|
|||||||
Hint = 4;
|
Hint = 4;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DiagnosticTag = {
|
||||||
|
-- Unused or unnecessary code
|
||||||
|
Unnecessary = 1;
|
||||||
|
-- Deprecated or obsolete code
|
||||||
|
Deprecated = 2;
|
||||||
|
};
|
||||||
|
|
||||||
MessageType = {
|
MessageType = {
|
||||||
-- An error message.
|
-- An error message.
|
||||||
Error = 1;
|
Error = 1;
|
||||||
@@ -521,6 +528,13 @@ export interface TextDocumentClientCapabilities {
|
|||||||
publishDiagnostics?: {
|
publishDiagnostics?: {
|
||||||
--Whether the clients accepts diagnostics with related information.
|
--Whether the clients accepts diagnostics with related information.
|
||||||
relatedInformation?: boolean;
|
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.
|
--Capabilities specific to `textDocument/foldingRange` requests.
|
||||||
--
|
--
|
||||||
@@ -706,6 +720,18 @@ function protocol.make_client_capabilities()
|
|||||||
dynamicRegistration = false;
|
dynamicRegistration = false;
|
||||||
prepareSupport = true;
|
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 = {
|
workspace = {
|
||||||
symbol = {
|
symbol = {
|
||||||
|
|||||||
Reference in New Issue
Block a user