rust-lang / rust-lang/rust-analyzer
rust-analyzer is ignoring "server.path" (either because of "remote" workspace, or NixOS, or both)
Open
Nobody has claimed this yet.
A-vscode
C-support
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
On NixOS, with code-server, rust-analyzer blows up before it even get a chance:
INFO [2/25/2022, 9:23:22 PM]: PersistentState: { serverVersion: undefined }
ERROR [2/25/2022, 9:23:22 PM]: Bootstrap error [Error: error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «stdin»:2:36:
1|
2| {srcStr, pkgs ? import <nixpkgs> {}}:
| ^
3| pkgs.stdenv.mkDerivation {
(use '--show-trace' to show detailed location information)
at /home/cole/.local/share/code-server/extensions/matklad.rust-analyzer-0.3.939/out/main.js:97:291
at ChildProcess.exithandler (child_process.js:390:5)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:400:28)
at Pipe.<anonymous> (net.js:686:12)]
- The patching that it does is rather brittle, has no escape hatch, requires NIX_PATH be set.
- It seems that
rust-analyzer.server.pathis ignored whenrust-analyzeris used on a remote workspace. I've done this in the past, I'm pretty sure things will just work if this were respected and used instead of the patching path.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the remote-workspace bootstrap that leads to the reported extension path in out/main.js, then inspect how rust-analyzer.server.path is handled. Reproduce the NixOS failure with code-server and determine whether the setting is bypassed; done means a configured server.path is honored without requiring the brittle Nix-based patching path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100