Skip to content

feat: support vim.diagnostic.is_disabled() #2232

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

Merged
merged 2 commits into from
Jun 10, 2023
Merged

feat: support vim.diagnostic.is_disabled() #2232

merged 2 commits into from
Jun 10, 2023

Conversation

sstallion
Copy link
Contributor

This PR adds support for checking vim.diagnostic.is_disabled() on nvim 0.9+. This function was added to support globally enabling or disabling diagnostics. This is especially useful for setups where diagnostics are enabled conditionally or on a project basis. There is no change in behavior for versions prior to 0.9.

Thanks for a great plugin!

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

Works nicely. We don't get a DiagnosticChanged event until switching buffers or writing, but that's Good Enough: the tree is refreshed reasonably quickly.

Many thanks for your contribution.

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

Please resolve styling issue.

@sstallion
Copy link
Contributor Author

Done. Thanks again!

@sstallion
Copy link
Contributor Author

sstallion commented May 27, 2023

I wonder if adding something similar to the following autocommands (from lsp.txt) would be enough:

autocmd User LspProgressUpdate redrawstatus
autocmd User LspRequest redrawstatus

I'll play around with this a bit today to see if this can close the gap.

@alex-courtis
Copy link
Member

I'll play around with this a bit today to see if this can close the gap.

That would be great, thank you. Instant updates would look great.

@sstallion
Copy link
Contributor Author

That would be great, thank you. Instant updates would look great.

I've been looking into this, this evening and it looks like updates may already be instant. After from_nvim_lsp() is called, signs will be cleared, which should achieve the desired result.

Would it be okay to merge this PR as-is? I'm not seeing much else that can be done to improve the responsiveness at this point.

@alex-courtis
Copy link
Member

Would it be okay to merge this PR as-is? I'm not seeing much else that can be done to improve the responsiveness at this point.

That's fine. The UX is great.

Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

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

Many thanks for your contribution.

@alex-courtis alex-courtis merged commit 8d82c4d into nvim-tree:master Jun 10, 2023
@sstallion
Copy link
Contributor Author

My pleasure. Thanks for a great plugin!

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