fix: simplify diagnostic config
This commit is contained in:
parent
318bd3e65c
commit
21d5aabc22
29
init.lua
29
init.lua
|
|
@ -628,30 +628,17 @@ require('lazy').setup({
|
|||
-- Diagnostic Config
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config {
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = { border = 'rounded', source = 'if_many' },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
signs = vim.g.have_nerd_font and {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = ' ',
|
||||
[vim.diagnostic.severity.WARN] = ' ',
|
||||
[vim.diagnostic.severity.INFO] = ' ',
|
||||
[vim.diagnostic.severity.HINT] = ' ',
|
||||
},
|
||||
} or {},
|
||||
virtual_text = {
|
||||
source = 'if_many',
|
||||
spacing = 2,
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = {
|
||||
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||
}
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
|
||||
-- Can switch between these as you prefer
|
||||
virtual_text = true, -- Text shows up at the end of the line
|
||||
virtual_lines = false, -- Teest shows up underneath the line, with virtual lines
|
||||
|
||||
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
|
||||
jump = { float = true },
|
||||
}
|
||||
|
||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
||||
|
|
|
|||
Loading…
Reference in New Issue