fix(diagnostic): remove unnecessary config lines

The following lines do nothing and can be removed:

 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,

The following line also serves little purpose, seemingly only reducing
the spacing between the end of lines and diagnostic virtual text by two
characters, so it can also be removed:

  spacing = 2,

The following line causes diagnostics which aren't of severity level
error to not have the specific text area underlined. This is less useful
than the default of showing underlines for all diagnostic levels, so
remove this line as well:

  underline = { severity = vim.diagnostic.severity.ERROR },
This commit is contained in:
Ronan Dalton 2025-05-18 13:20:27 +12:00
parent 6ba2408cdf
commit eae3e03b42
1 changed files with 0 additions and 11 deletions

View File

@ -631,7 +631,6 @@ require('lazy').setup({
vim.diagnostic.config { vim.diagnostic.config {
severity_sort = true, severity_sort = true,
float = { border = 'rounded', source = 'if_many' }, float = { border = 'rounded', source = 'if_many' },
underline = { severity = vim.diagnostic.severity.ERROR },
signs = vim.g.have_nerd_font and { signs = vim.g.have_nerd_font and {
text = { text = {
[vim.diagnostic.severity.ERROR] = '󰅚 ', [vim.diagnostic.severity.ERROR] = '󰅚 ',
@ -642,16 +641,6 @@ require('lazy').setup({
} or {}, } or {},
virtual_text = { virtual_text = {
source = 'if_many', 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,
}, },
} }