nixos-vscode-server icon indicating copy to clipboard operation
nixos-vscode-server copied to clipboard

Rust-analyzer support

Open chrisguida opened this issue 1 year ago • 4 comments

How can I add extensions to vscode-server such as rust-analyzer?

This would be amazing as I would be able to use rust-analyzer while coding on a remote machine.

chrisguida avatar Dec 06 '23 20:12 chrisguida

You can already do this just as with any other extension installation. Go to the "Extension Marketplace" and enable the rust-analyzer extension. It will auto-detect NixOS and make the appropriate adjustments.

samuela avatar Apr 04 '24 23:04 samuela

Hmm, this definitely didn't work when I tested. Is this a new feature?

chrisguida avatar Apr 16 '24 23:04 chrisguida

@chrisguida in your configuration.nix

environment.systemPackages = with pkgs; [
    vscode-extensions.rust-lang.rust-analyzer

  ];

https://search.nixos.org/packages?channel=23.11&show=vscode-extensions.rust-lang.rust-analyzer&from=0&size=50&sort=relevance&type=packages&query=vscode-extensions.rust-lang.rust-analyzer

N-T-K avatar Apr 24 '24 23:04 N-T-K

@N-T-K thanks, that seems to have gotten me partly there

I now have this:

2024-04-25T19:19:36.599526Z ERROR rust_analyzer::main_loop: FetchWorkspaceError:
rust-analyzer failed to load workspace: Failed to load the project at /home/cguida/work/smaug/Cargo.toml: Failed to query rust toolchain version at /home/cguida/work/smaug, is your toolchain setup correctly?: cd "/home/cguida/work/smaug" && "cargo" "--version" failed: No such file or directory (os error 2)

cargo doesn't exist because it's inside nix develop. how can i fix this?

chrisguida avatar Apr 25 '24 19:04 chrisguida