Skip to content
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 hangs when performing "code actions" in Helix #12915

Closed
schlich opened this issue Aug 16, 2024 · 8 comments
Closed

ruff server hangs when performing "code actions" in Helix #12915

schlich opened this issue Aug 16, 2024 · 8 comments

Comments

@schlich
Copy link

schlich commented Aug 16, 2024

Might be related to Issue #416 in ruff-lsp, particularly @ssmsossah's comment here that the same thing is happening in NeoVim.

Running ruff server in Helix. Health checks with hx --health python all pass.

Helix 24.7
ruff 0.6.0
protocol error: InternalError: failed to deserialize diagnostic data: missing field 'range'

[[language]]
name = "python"
formatter = { command = "ruff", args = ["format", "-"]}
language-servers = ["ruff", "pyright", "pylsp"]

[language-server.pyright.config.python.analysis]
typeCheckingMode = "basic"

[language-server.ruff]
command = "ruff"
args = ["server"]
@schlich
Copy link
Author

schlich commented Aug 16, 2024

Welp, looks like I just rubber-ducked my way out of this one. dunno how that misconfig slipped in but changing args = ["server"] to config = { settings = { args = ["server"] } } as suggested in the helix docs fixed the issue... closing.

@schlich schlich closed this as completed Aug 16, 2024
@dhruvmanila
Copy link
Member

dhruvmanila commented Aug 16, 2024

I'm a bit confused here. What was the exact change? The args = ["server"] should be correct unless Helix changed something. Can you provide the docs reference for this?

@schlich
Copy link
Author

schlich commented Aug 16, 2024

@dhruvmanila it's here

[language-server.ruff]
command = "ruff"
config = { settings = { args = ["server"] } }

@dhruvmanila
Copy link
Member

That's weird because their documentation mentions the use of args:

args | A list of arguments to pass to the language server binary

while, the config key is actually the initialization options which is different.

I'll need to try this out.

@dhruvmanila
Copy link
Member

I'm getting code actions:

Screenshot 2024-08-16 at 14 39 26

Using the following config:

[[language]]
name = "python"
language-servers = ["ruff", "pyright"]

[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]

[language-server.ruff]
command = "ruff"
args = ["server"]

@schlich
Copy link
Author

schlich commented Aug 16, 2024

that is weird. if you think it's worth further reproducing the issue on my end, just let me know @dhruvmanila. Maybe there are logs I can pull? The related issues make me skeptical it's a Helix-specific problem

@dhruvmanila
Copy link
Member

Is the config that you provided in the PR description complete? If not, could you provide the remaining parts? I'm curious whether you're using python-lsp-ruff (plugin to pylsp).

It might also be worth discussing this with the Helix team. Is it args or config? Because, we're using args in our setup guide :)

@schlich
Copy link
Author

schlich commented Aug 16, 2024

Yes, that was the complete config for the python language. I tried it with various combinations of pylsp, pyright, and pylyzer. definitely was not including python-lsp-ruff even though i have used it in the past, I was assuming hopefully correctly that ruff server was a full replacement.

I just confirmed the error is persisting when i revert the change, right now i'm just running ruff and pylyzer

we're using args in our setup guide

ah, so that's how i ended up there!

pineapplehunter pushed a commit to pineapplehunter/nixos-config that referenced this issue Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants