notify of all LSP errors

This commit is contained in:
Christian Nieves
2023-06-23 15:13:43 -05:00
parent 2ce85a8584
commit 86ddcdb594
2 changed files with 18 additions and 18 deletions

View File

@ -187,6 +187,23 @@ local conditionalSources = {
},
}
vim.lsp.handlers["window/showMessage"] = function(_, result, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id)
local lvl = ({
"ERROR",
"WARN",
"INFO",
"DEBUG",
})[result.type]
notify({ result.message }, lvl, {
title = "LSP | " .. client.name,
timeout = 1000,
keep = function()
return lvl == "ERROR" or lvl == "WARN"
end,
})
end
if use_google() then
require("cmp_nvim_ciderlsp").setup()
@ -212,23 +229,6 @@ if use_google() then
notify("ctx:" .. ctx, "info", { timeout = 900 })
end
cider_lsp_handlers["window/showMessage"] = function(_, result, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id)
local lvl = ({
"ERROR",
"WARN",
"INFO",
"DEBUG",
})[result.type]
notify({ result.message }, lvl, {
title = "LSP | " .. client.name,
timeout = 1000,
keep = function()
return lvl == "ERROR" or lvl == "WARN"
end,
})
end
capabilities = require("cmp_nvim_ciderlsp").update_capabilities(capabilities)
capabilities.workspace.codeLens = { refreshSupport = true }
capabilities.workspace.diagnostics = { refreshSupport = true }

View File

@ -19,7 +19,7 @@ require("nvim-treesitter.configs").setup({
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
-- additional_vim_regex_highlighting = true,
additional_vim_regex_highlighting = { "java" },
-- additional_vim_regex_highlighting = { "java" },
},
-- rainbow = {
-- enable = true,