This commit is contained in:
2025-02-16 20:11:07 -08:00
parent 8742b343b3
commit 9f6f878fb7
6 changed files with 148 additions and 67 deletions

View File

@@ -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