Closed ghost closed 7 years ago
Thanks for your contribution! This is definitely a worthwhile improvement.
This code currently assumes that rustc
is on path, which leads to:
ELISP> (concat (shell-command-to-string "rustc --print sysroot") "/lib/rustlib/src/rust/src")
"zsh:1: command not found: rustc\n/lib/rustlib/src/rust/src"
I suggest we use (executable-find "rustc")
to confirm that rustc is on path first.
In the spirit of not breaking people's setups, I think we should still fall back to "/usr/local/src/rust/src"
. Users might be depending on that.
Updated pull request.
racer-rust-src-path
will now verify that rustc is in path, and if so, will check if the rust source has been installed via rustup. If present, use it, otherwise fall back to "/usr/local/src/rust/src"
as default.
I think this would allow users of rustup to safely ignore racer-rust-src-path
, while remaining backwards compatible with current users.
Thanks! :)
Fixes issue #54. Works for both old and new versions of racer.