Merge upstream: fix: simplify diagnostic config

This commit is contained in:
Damjan 9000 2026-03-15 12:15:50 +01:00
commit fd64e14fe8

View File

@ -116,30 +116,17 @@ return {
-- 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.