-
Notifications
You must be signed in to change notification settings - Fork 15
Virtual text not always displaying #40
Comments
For me, |
I can confirm that behavior as well. Are you able to test |
I think I can confirm that this bug is not related to virtual text, but to the diagnostics itself. I've switched from using virtual texts to popups on CursorHold (#29) and I see the same phenomenon:
Before: After: I can confirm this happens with |
I tried disabling At this point I'm thinking something may be wrong with Also. I did not know that vanilla nvim-lsp had signs and virtual text: https://github.com/neovim/neovim/blob/91572ddad185c2c4f6d266543d66919543c5bb2a/runtime/lua/vim/lsp/callbacks.lua#L100. As a side note it may be good to specify in the README how this plugin differs/enhances the default experience. |
So, the only artifact that (seems to) remain after calling vim.lsp.util.buf_clear_diagnostics is the stuff fetched by vim.lsp.util.show_line_diagnostic (and The former gets its values from vim.lsp.util.get_line_diagnostics, which sources them from Here's M.buf_clear_diagnostics: function M.buf_clear_diagnostics(bufnr)
validate { bufnr = {bufnr, 'n', true} }
bufnr = bufnr == 0 and api.nvim_get_current_buf() or bufnr
-- clear sign group
vim.fn.sign_unplace(sign_ns, {buffer=bufnr})
-- clear virtual text namespace
api.nvim_buf_clear_namespace(bufnr, diagnostic_ns, 0, -1)
end Which indeed doesn't remove anything from Adding |
confirmed failing for me too.. if you don't include |
It seems that the virtual text function ( |
I'll say that I noticed the "break" when i switched to the new github org of nvim-lua from @haorenW1025 's own account. |
Do you remember around what commit that was? I noticed a lot of these bugs popped up about that time. I could Edit: I believe I've figured out where the function is failing: buffer_line_diagnostics = all_buffer_diagnostics[bufnr]
if not buffer_line_diagnostics then
return
end
for line, line_diags in pairs(buffer_line_diagnostics) do
-- …
end Here, On that note, I see that |
Sorry, after thinking about it for a bit more it may be that my issue is not the same as the issue in this post. I never had the problem that virtual text wasn't always displayed. My problem is that it's sometimes displayed when I think it shouldn't. But after investigating I've found out that:
So, sorry for the noise. I'll create issues elsewhere once I've dug some more. For later reference, the full nvim-lsp debugging output.
[1]: Unlikely, checking the debugging output shows that nvim-lsp takes the simple approach of just including the entire file, which makes sense and is allowed. It's hard to mess that up. |
@haorenW1025 any thoughts around this? |
Sorry for the responding... I was too busy this couple days. However I haven't noticed any issue on my side(mainly using sumneko_lua and clangd). I made a possible fix and please try if it solves your issues. |
I think d7734f1 is just a partial fix, |
@aktau Yeah the fix should be in the neovim repo, please tag me if you open a PR, thanks:) |
Done. Also, once again I got confused as this issue (as described by @Iron-E) is likely not exactly the same thing as what I'm experiencing. Of course, fixing my bug will mean less potential confusion/causes. From the original report, I only experienced the following (highlighted):
Let's see if the fixes make the second issue go away, and then we could deal with the first (if it can be reproduced). |
Okay, so I went ahead and performed a local merge of your @aktau's using neovim/neovim as a base (I don't use the appimage anyway). This issue has been fixed:
However this issue still persists for me:
and
Here are some screenshots to demonstrate the issue. Edit: I recompiled today and both issues are occurring. I will make note on the PR. |
confirmed, same behaviour; add elixirls to that list of ones not showing virtualtext, but shows the sign in signcolumn. |
@haorenW1025 I've made a pull-request that fixes this issue for me, check out #50. |
I can confirm that #50 has fixed the issue. I will close it. Thank you! |
From #36:
I'll add that currently
omnisharp
is one of the more troubled language servers withnvim_lsp
, so it's odd that it's working there.Popups work on all servers I've tried, and so do items in the sign column.
The text was updated successfully, but these errors were encountered: