Merge pull request #170 from Pocco81/dev-lsp
Lang servers error suppression and better "publish diagnostics" glyph
This commit is contained in:
commit
c1544dd020
|
@ -94,3 +94,29 @@ vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnos
|
||||||
vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"})
|
vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"})
|
||||||
vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"})
|
vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"})
|
||||||
vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"})
|
vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"})
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/publishDiagnostics"] =
|
||||||
|
vim.lsp.with(
|
||||||
|
vim.lsp.diagnostic.on_publish_diagnostics,
|
||||||
|
{
|
||||||
|
virtual_text = {
|
||||||
|
-- prefix = "",
|
||||||
|
prefix = "",
|
||||||
|
spacing = 0
|
||||||
|
},
|
||||||
|
signs = true,
|
||||||
|
underline = true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- suppress error messages from lang servers
|
||||||
|
vim.notify = function(msg, log_level, _opts)
|
||||||
|
if msg:match("exit code") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if log_level == vim.log.levels.ERROR then
|
||||||
|
vim.api.nvim_err_writeln(msg)
|
||||||
|
else
|
||||||
|
vim.api.nvim_echo({{msg}}, true, {})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue