-
Notifications
You must be signed in to change notification settings - Fork 46
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
No code actions available when hovered over certain warnings #94
Comments
Hmm, ok, still seems to work on 0.9.0. Do you have other plugins installed, anything else that could be impacting this? |
Not sure what it could be. I disabled pyright that was running beside it. I commented out the ruff-lsp lines from lspconfig. Just to give some background, I'm running astronvim. The base config files for lsp stuff (utils/lsp.lua and plugins/configs/lspconfig.lua) don't seem to reveal anything that could be causing this (at least to my eyes). Another user on the astronvim discord reported the same issue too, so perhaps it's an "us" problem. Though I wonder why #91 (comment) ran into the same problem. I'll try to mess around a bit more to isolate it. |
Ah no worries. I think those two errors aren't actually fixable though, so it seems right for there to be no code actions available. |
Should file-wide actions (like fix-all and org-imports) still be unavailable though? They are available on empty lines and other unrelated fixable warnings. Sorry I'm not sure how code actions for other LSPs usually work. |
Oh, hmm, maybe? I'd say yes? But I'm not 100% certain either, it could vary from client to client, but I'm confused as to why it would suppress them there. |
I'm coming from VSCode, where the actions are available in such situations, so I thought it was strange. Also ran into it when testing out performing code actions on save in order to auto-sort imports in nvim. IMO they should be available, but not sure how to do so for nvim. Feel free to close this issue, unless you think it could be fixed from the language server side and not the client. Thanks. |
I took the time to create a minimal repro for an issue that I saw that may be an example of this: https://github.com/burnettk/assorted-repro-scenarios/tree/main/ruff-lsp-bug-repro. Basically, with the following code, even though there are linting issues on both lines. there are no code actions for line 1, but there are code actions for line 2: def sureEnough():
a = 1
print("I'm sure")
sureEnough() |
I'm pretty confident it's the same issue: #128 It should be fixed on HEAD. Let me do a quick test with the examples mentioned in this issue. @charliermarsh we would probably need to make a patch release. |
Yeah, it's the same issue. It's fixed with #129 |
When hovering over certain warnings, like F401, no code actions are available. This seems to be unintended as the first example gif in the readme (https://github.com/charliermarsh/ruff-lsp#quick-fix-actions-for-auto-fixable-violations-like-unused-imports) shows available code actions when hovering F401.
Environment: neovim 0.9.0, ruff-lsp 0.0.24
Steps to reproduce:
:lua =vim.lsp.buf.code_action()
Another diagnostic code that causes this issue is F821(undefined name). Per #91 (comment) this may affect quite a few more types of warnings.
The text was updated successfully, but these errors were encountered: