config/nvim/lua/lsp/providers/tsserver.lua (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
return {
setup = {
handlers = {
["textDocument/publishDiagnostics"] = function(_, _, p, id, _, cfg)
if p.diagnostics ~= nil then
local i = 1
while i <= #p.diagnostics do
if p.diagnostics[i].code == 80001 then
table.remove(p.diagnostics, i)
else
i = i + 1
end
end
end
vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, id, _, cfg)
end,
},
},
}
|