2022-03-01 02:58:43 +00:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.config()
|
|
|
|
local signs = {
|
|
|
|
{ name = "DiagnosticSignError", text = "" },
|
|
|
|
{ name = "DiagnosticSignWarn", text = "" },
|
|
|
|
{ name = "DiagnosticSignHint", text = "" },
|
|
|
|
{ name = "DiagnosticSignInfo", text = "" },
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, sign in ipairs(signs) do
|
|
|
|
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
|
|
|
end
|
|
|
|
|
|
|
|
local config = {
|
|
|
|
virtual_text = false,
|
|
|
|
signs = {
|
|
|
|
active = signs,
|
|
|
|
},
|
|
|
|
update_in_insert = true,
|
|
|
|
underline = true,
|
|
|
|
severity_sort = true,
|
|
|
|
float = {
|
|
|
|
focusable = false,
|
|
|
|
style = "minimal",
|
|
|
|
border = "rounded",
|
|
|
|
source = "always",
|
|
|
|
header = "",
|
|
|
|
prefix = "",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
vim.diagnostic.config(config)
|
|
|
|
|
|
|
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
|
|
|
|
border = "rounded",
|
|
|
|
})
|
|
|
|
|
|
|
|
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
|
|
|
border = "rounded",
|
|
|
|
})
|
2022-03-01 05:31:16 +00:00
|
|
|
|
|
|
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
2022-03-01 07:25:09 +00:00
|
|
|
virtual_text = false,
|
2022-03-01 05:31:16 +00:00
|
|
|
})
|
2022-03-01 02:58:43 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|