Reputation: 21
I've recently started trying out terminal-based text editors. I've decided to dive into Helix, but I've been having a problem with the rust LSP: it wont work.
What could be causing the Rust LSP (rust-analyzer) to not work in Helix, despite being recognized and correctly configured? If anyone could point me in the right direction that would be very helpful.
I've made sure that helix recognizes the LSP
$ hx --health rust
Configured language servers:
✓ rust-analyzer: /home/aknen/.cargo/bin/rust-analyzer
Configured debug adapter: lldb-vscode
Binary for debug adapter: 'lldb-vscode' not found in $PATH
Configured formatter: None
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✓
I've also made sure that it's in PATH
$ rust-analyzer --version
rust-analyzer 1.78.0 (9b00956 2024-04-29)
I tried to install a Python LSP, and it worked immediately without any additional tinkering. So, this confirms the problem is specific to rust.
For reference, here's my languages.toml
file:
[[language]]
name = "rust"
scope = "source.rust"
file-types = ["rs"]
roots = ["Cargo.toml"]
language-servers = [ "rust-analyzer" ]
[language-server.rust-analyzer]
command = "rust-analyzer"
args = ["--stdio"]
[[language]]
name = "python"
scope = "source.python"
file-types = ["py"]
roots = ["setup.py", "requirements.txt", "pyproject.toml", ".git", "Pipfile"]
language-servers = [ "pylsp" ]
[language-server.pylsp]
command = "/home/aknen/miniconda3/bin/pylsp"
args = []
I've also tried using the full path to rust-analyzer
and that didn't work either.
Upvotes: 2
Views: 533
Reputation: 1299
Check the logs with hx --log /tmp/helix.log -vvv
and open it up with tail -F /tmp/helix.log
. It will tell you if rust-analyzer fails to start.
Upvotes: 0