-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ruff server
: No diagnostics in Neovim
#11022
Comments
I think I need to look into this as it might be the new parser which is causing it. |
@MithicSpirit Is it like on any code that the diagnostics aren't visible or is it a specific one? Does it contain syntax errors? Is it possible for you to share a small snippet from it? Are you seeing any error messages while you type? |
@dhruvmanila Seems to be that all diagnostics are not visible on all code. The code I've been using for testing is just the one-liner
As a side note, there are a lot of messages being printed to stderr that are not error messages (mostly "file changed" notifications), but all of these get picked up as EDIT: just tried doing this inside another project (tried with https://github.com/pandas-dev/pandas because why not) and the first and third messages ("No workspaces" and "No ruff settings file") did not appear in |
I am experiencing a similar issue with Helix (v24.3), for example:
but the diagnostics don' show up and when I look at the log I have a lot of these messages:
I have no idea where all those "┘" are coming from! None of this shows up with |
@bluthej I think the "┘" are a side-effect of how we currently log things. Right now, the LSP logs to I'm currently investigating why diagnostics don't appear in Neovim, and my guess is that the problems you're experiencing in Helix are probably related. |
As per the discussion with @snowsignal on the Discord, the issue appears to be with pull diagnostics. Building the latest Neovim commit from source, which has support therefor, fixes the issue. I think it would be appropriate to document the requirement for pull diagnostics and update the Neovim setup guide to mention 0.10 (not yet released) is required for diagnostics. |
@bluthej This is also why Helix diagnostics don't work yet - pull diagnostics aren't supported by the Helix LSP client yet. There was a recent pull request to implement them, but unfortunately it's been abandoned. |
I've created a new issue to track implementation of |
Oh wow, good find. I'm always on Neovim nightly which is why I did not see this behavior. Thanks for debugging it! I think we could technically create an integration test, at least for Neovim, to check that certain features work on the latest (two?) stable version. |
@MithicSpirit This was fixed in |
Description
When using
ruff server
, there appear to be no diagnostics in Neovim (although other features work as expected). This issue is not reflected inruff_lsp
.Minimal example
I have been able to reproduce the following in Docker (Arch and Alpine images) after installing neovim, git, and ruff/ruff_lsp (through pipx).
repro.lua
(basic lazy.nvim MWE template + nvim-lspconfig setup)nvim -u repro.lua
to install plugins, then quit after they are installednvim -u repro.lua test.py
and try typing some code that ruff would complain about (no diagnostics; unexpected)As a sanity check, you can also try the following:
import foo
), use<Space>ca
to open the code actions menu, and select option1
to trigger the fix (code is fixed; expected)repro.lua
to change the last line torequire('lspconfig').ruff_lsp.setup {}
(basically just add the_lsp
)The text was updated successfully, but these errors were encountered: