Closed diktomat closed 1 year ago
I'm not sure I understand this issue. This extension (and Rust Analyzer) assume that Cargo is on your $PATH
, which looks to be the case since which
is working as you expect. Could you be more descriptive as to what is failing?
They're in PATH in my shell, but Nova/the extension don't eval my fish config, so their path is only the macOS standard one without additions for rust or cargo.
Aha! Thanks for providing more details, I think I understand better. I looked and even if I had an extension preference for setting a custom Cargo path (which I'm not inclined to do), Rust Analyzer doesn't offer a way to configure it to use a custom Cargo path. I think the only recourse is to somehow set the $PATH
in Nova.
Have you already tried adding PATH=$PATH:/Users/bene/.local/share/cargo/bin
to the env vars in this extension's preferences? I can't be sure this would resolve correctly but it's worth trying first.
If you look in Nova Preferences -> Tools, you'll see this section:
You'll note it takes environment variables from your "login shell" which I assume you left as zsh
, but below that is another place to add global environment variables, so if it didn't work for the extension preferences you could try again here.
A final option, which it sounds like you'll dislike, is to augment the $PATH
in a dotfile that zsh
will pick up.
Nah, my login shell is Fish. But adding PATH manually works for me, thank you!
Is your feature request related to a problem? Please describe. As I like my dotfiles clean, I installed rustup and cargo to
~/.local
, where it isn't detected unless the environment variables are set appropriately. This results in errors by this extension, see below. ACargo.toml
is actually there in the root directory of the project.Describe the solution you'd like Let me choose Rustup/Cargo paths.
Describe alternatives you've considered Tried to set
$RUSTUP_HOME
/$CARGO_HOME
env variables in the extension settings without effect.Additional context Captured in the sample grep project from the Rust book for simplicity.
All used commands are actually installed:
Errors:
Env vars in extension settings:
Project file tree: