Skip to content
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

fix(statusline): display null-ls linters properly #2921

Merged

Conversation

choplin
Copy link
Contributor

@choplin choplin commented Aug 18, 2022

Description

null-ls linters may have either DIAGNOSTIC, DIAGNOSTIC_ON_OPEN, or DIAGNOSTIC_ON_SAVE as its method parameter. e.g., https://github.com/jose-elias-alvarez/null-ls.nvim/blob/8914051a3d399e9715833ad76bbf5fe69ea7faf0/lua/null-ls/builtins/diagnostics/buf.lua#L12

Currently, only linters with DIAGNOSTIC are shown in the lsp component on the statusline regardless of whether the linters are registered and work properly.

This is due to lvim.lsp.null-ls.linters.list_registers returning only linters with DIAGNOSTIC.

This PR makes that function retrieve the linters with all three method types and return the merged list.

How Has This Been Tested?

  • Register buf null-ls linter, which is set to DIAGNOSTIC_ON_SAVE, open a supported file (i.e., proto file), then check if buf linter is shown in the statusline.

null-ls linters may have either DIAGNOSTIC, DIAGNOSTIC_ON_OPEN,
or DIAGNOSTIC_ON_SAVE as its method parameter, but only linters
with DIAGNOSTIC are shown in statusline regardless of whether the linters
are registered properly.
@choplin choplin force-pushed the bugfix/fix-nullls-linter-statusline-display branch from 01836a7 to c8cb154 Compare August 18, 2022 07:47
@choplin
Copy link
Contributor Author

choplin commented Aug 18, 2022

null-ls formatters may have an alternative method as RANGE_FORMATTING as well. But, it seems that no built-in formatters of null-ls have only RANGE_FORMATTING method (all formatters that have RANGE_FORMATTING also have FORMATTING method). So, I didn't make changes to formatters.

@kylo252 kylo252 merged commit d259efd into LunarVim:rolling Aug 19, 2022
@choplin choplin deleted the bugfix/fix-nullls-linter-statusline-display branch August 20, 2022 08:37
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.

2 participants