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
|
-- Diagnostic Config
|
||||||
-- See :help vim.diagnostic.Opts
|
-- See :help vim.diagnostic.Opts
|
||||||
vim.diagnostic.config {
|
vim.diagnostic.config {
|
||||||
|
update_in_insert = false,
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
float = { border = 'rounded', source = 'if_many' },
|
float = { border = 'rounded', source = 'if_many' },
|
||||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||||
signs = vim.g.have_nerd_font and {
|
|
||||||
text = {
|
-- Can switch between these as you prefer
|
||||||
[vim.diagnostic.severity.ERROR] = ' ',
|
virtual_text = true, -- Text shows up at the end of the line
|
||||||
[vim.diagnostic.severity.WARN] = ' ',
|
virtual_lines = false, -- Teest shows up underneath the line, with virtual lines
|
||||||
[vim.diagnostic.severity.INFO] = ' ',
|
|
||||||
[vim.diagnostic.severity.HINT] = ' ',
|
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
|
||||||
},
|
jump = { float = true },
|
||||||
} 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,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
-- LSP servers and clients are able to communicate to each other what features they support.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue