Skip to content

fix: remove unnecessary diagnostic config lines #1550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ronandalton
Copy link

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 },

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 },
@ronandalton ronandalton force-pushed the fix-unnecessary-diagnostic-config branch from 253732e to eae3e03 Compare May 18, 2025 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant