update
This commit is contained in:
@@ -86,13 +86,19 @@ vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
||||
end
|
||||
end
|
||||
|
||||
-- table from lsp severity to vim severity.
|
||||
local severity = {
|
||||
"error",
|
||||
"warn",
|
||||
"info",
|
||||
"info", -- map both hint and info to info?
|
||||
}
|
||||
vim.lsp.handlers["window/showMessage"] = function(err, method, params, client_id)
|
||||
vim.notify(method.message, severity[params.type])
|
||||
vim.lsp.handlers["window/showMessage"] = function(err, result, ctx)
|
||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||
local lvl = ({
|
||||
"ERROR",
|
||||
"WARN",
|
||||
"INFO",
|
||||
"DEBUG",
|
||||
})[result.type]
|
||||
vim.notify("LSP Message: " .. result.message, lvl, {
|
||||
title = "LSP | " .. client.name,
|
||||
timeout = 5000,
|
||||
keep = function()
|
||||
return lvl == "ERROR" or lvl == "WARN"
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user