-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Diagnostic Indicators Not Updating #2990
Comments
For a dramatic example, set |
Sorry, I did not test/compare enough with the old behavior. The diagnostic will show up after saving for example. But this is clearly a regression. The issue is this line: nvim-tree.lua/lua/nvim-tree/diagnostics.lua Line 175 in 610a1c1
I am not sure if I fully understand With the following debug output in
...you can see a lot of output with So it would help to remove the linked line above. The downside of this is that if some neovim user decides to attach an LSP to Not sure how complex it will become but it maybe possible to actually fix this by filtering on the |
That sounds right - I was similarly misdirected. bufnr is indeed the tree rather than the diagnostic buf.
local should_draw = bufnr
and vim.api.nvim_buf_is_valid(bufnr)
and vim.api.nvim_buf_is_loaded(bufnr)
and vim.api.nvim_get_option_value("buflisted", { buf = bufnr })
if should_draw then
error("diagnostics calling explorer draw")
local explorer = core.get_explorer()
I like that idea; all the information is present in the event, and only contains the buffers whose diagnostics have changed e.g. if opts.diagnostics.enable then
create_nvim_tree_autocmd("DiagnosticChanged", {
callback = function(data)
log.line("diagnostics", "DiagnosticChanged %s", vim.inspect(data))
require("nvim-tree.diagnostics").update() One problem was present, added a second.
|
Let's get a good solution for LSP first, as it's the primary use case. We can adapt for COC afterwards: it's much simpler with a shotgun approach. I'd be most grateful for a PR! |
I've added you as a collaborator so that you can push branches and always run CI. |
Okay, I will have a look into this. But this may take some time, since I am a few days before entering vacation. Should I create a PR that removes |
Thank you, that small change sounds like the best thing to do. |
This ensures that LSP diagnostics of files which are not manually opened by users are rendered by nvim-tree diagnostic indicators. However when users attach an LSP to nvim-tree this will bring back flashing as attempted to fix in #2980. Fixing this should probably done by checking data passed via diagnostic events (DiagnosticChanged and CocDiagnosticChanged). Signed-off-by: des-b <66919647+des-b@users.noreply.github.com>
…() (#2998) This ensures that LSP diagnostics of files which are not manually opened by users are rendered by nvim-tree diagnostic indicators. However when users attach an LSP to nvim-tree this will bring back flashing as attempted to fix in #2980. Fixing this should probably done by checking data passed via diagnostic events (DiagnosticChanged and CocDiagnosticChanged). Signed-off-by: des-b <66919647+des-b@users.noreply.github.com>
That's quite a lot of duplicated data in that |
Yes, it needs a bit of a rethink.
Perhaps looking at deltas between events.
In the meantime you could increase the debounce time.
…On Tue, 12 Nov 2024, 04:00 kah-ell, ***@***.***> wrote:
That's quite a lot of duplicated data in that DiagnosticChanged event,
considering how often those are fired.
—
Reply to this email directly, view it on GitHub
<#2990 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALPQYSLSBX3KQNUMSFI6CL2ADPB7AVCNFSM6AAAAABRHUCPX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRYGY2DAMJZGA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Description
Diagnostic signs are eventually showing correctly however they take some time.
Regression since 82ab19e
Can I please leave this with you @des-b ?
Neovim version
Operating system and version
Linux 6.11.5-arch1-1
Windows variant
No response
nvim-tree version
82ab19e
Clean room replication
Steps to reproduce
Change to nvim-tree source
echo "foo bar" > lua/nvim-tree/notify.lua
nvim -nu /tmp/nvt-min.lua lua/nvim-tree/log.lua
:NvimTreeFindFile
Expected behavior
notify.lua should be marked with a red diagnostic sign
Actual behavior
:w
on log.lua will update the statusThe text was updated successfully, but these errors were encountered: