Added base folke setup
This commit is contained in:
26
lua/plugins/lsp/diagnostics.lua
Normal file
26
lua/plugins/lsp/diagnostics.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local M = {}
|
||||
|
||||
M.signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
|
||||
function M.setup()
|
||||
-- Automatically update diagnostics
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = { spacing = 4, prefix = "●" },
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx)
|
||||
local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id)
|
||||
pcall(vim.diagnostic.reset, ns)
|
||||
return true
|
||||
end
|
||||
|
||||
for type, icon in pairs(M.signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
Reference in New Issue
Block a user