Skip to content

rust-analyzer is ignoring "server.path" (either because of "remote" workspace, or NixOS, or both) #11559

@colemickens

Description

@colemickens

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)]
  1. The patching that it does is rather brittle, has no escape hatch, requires NIX_PATH be set.
  2. It seems that rust-analyzer.server.path is ignored when rust-analyzer is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-vscodevscode plugin issuesC-supportCategory: support questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions