mirror of
https://github.com/CompeyDev/my-nvim-setup.git
synced 2024-12-13 05:20:38 +00:00
feat: suppressed error messages from lang servers and added better glyph for publish diagnostics
This commit is contained in:
parent
665fa24783
commit
1e2d299bf9
1 changed files with 26 additions and 0 deletions
|
@ -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 a new issue