You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created my own autocmd: when saving the buffer (BufWritePost event) using the plugin https://github.com/mfussenegger/nvim-lint the linter is started, and its messages are added to diagnostics for the current buffer with the warning level.
In my case, it works like this:
I save the current buffer
LSP adds diagnostics
The linter is triggered
The linter adds diagnostics
When updating diagnostics, nvim-tree processes only those diagnoses that are contained in the "DiagnosticChanged" event. This is a problem for me because the "DiagnosticChanged" event occurs two times: in step 2 and in step 4.
If the diagnostics added by the linter will not contain diagnostic with the error level, and in the nvim-tree settings I will specify:
severity = {
min = vim.diagnostic.severity.ERROR,
max = vim.diagnostic.severity.ERROR,
}
then the diagnostics will not be displayed at all for the file in the nvim-tree.
I think it's more correct to analyze the entire diagnostics list for the buffer, which can be obtained using the vim.diagnostic.get function.
Description
Diagnostic indicators are based only on messages from the "DiagnosticChanged" event, not from the entire buffer
I use nvim for Go (GoLang) development. I set up the lsp and linter using https://github.com/mfussenegger/nvim-lint.
I created my own autocmd: when saving the buffer (BufWritePost event) using the plugin https://github.com/mfussenegger/nvim-lint the linter is started, and its messages are added to diagnostics for the current buffer with the warning level.
In my case, it works like this:
When updating diagnostics, nvim-tree processes only those diagnoses that are contained in the "DiagnosticChanged" event. This is a problem for me because the "DiagnosticChanged" event occurs two times: in step 2 and in step 4.
If the diagnostics added by the linter will not contain diagnostic with the error level, and in the nvim-tree settings I will specify:
then the diagnostics will not be displayed at all for the file in the nvim-tree.
I think it's more correct to analyze the entire diagnostics list for the buffer, which can be obtained using the
vim.diagnostic.get
function.Neovim version
Operating system and version
Linux 5.15.173-1-MANJARO
Windows variant
No response
nvim-tree version
master
Clean room replication
Steps to reproduce
Not provided
Expected behavior
No response
Actual behavior
No response
The text was updated successfully, but these errors were encountered: