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

@ronandalton ronandalton commented May 18, 2025

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 (EDIT: this change was omitted in the final patch):

  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
@guru245
Copy link
Contributor

guru245 commented Jun 19, 2025

I agree with the first one. But IMHO the second and the third one are a matter of preference and so we don't really need to change.

@ronandalton
Copy link
Author

I somewhat agree, but if it's a matter of preference then I think it shouldn't be in kickstart to begin with. There should be a good usability/QoL reason to deviate from the default nvim behavior and increase the config size, and I'm not seeing it. The underline config makes the experience worse than the default because now you can't tell which part of the line has the issue. The spacing = 2 line can stay if that's what people want - I don't think that makes much difference either way.

@rivenirvana
Copy link
Contributor

For posterity's sake, the current default value for spacing is 4, if anyone wants to contest its inclusion in the config.

@guru245
Copy link
Contributor

guru245 commented Jun 21, 2025

@ronandalton Oh I didn't know the underline config is pointing to the exact part that has the issue. Good to know. Thanks.

The remaining part is spacing. I can see the spacing is 4 by default. But it was already set to 2 for inexplicable reason and many people are already using it and have gotten used to it I think. So I was wondering if it was worth changing it. I'm just saying my humble opinion. 😊

@ronandalton
Copy link
Author

That seems fair, since it has already been changed and returning the spacing to 4 would show less text on the screen in comparison to now, which could be seen as a regression.

I will update my patch to omit the removal of the spacing = 2 line.

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 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 eae3e03 to 7c31d2c Compare June 21, 2025 01:04
Copy link
Contributor

@guru245 guru245 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants