Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

racer-rust-src-path defaults to rustup source directory #72

Merged
merged 2 commits into from Dec 27, 2016
Merged

racer-rust-src-path defaults to rustup source directory #72

merged 2 commits into from Dec 27, 2016

Conversation

ghost
Copy link

@ghost ghost commented Dec 23, 2016

Fixes issue #54. Works for both old and new versions of racer.

@coveralls
Copy link

coveralls commented Dec 23, 2016

Coverage Status

Coverage remained the same at 66.106% when pulling c843e09 on jonves:master into 485b827 on racer-rust:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 66.106% when pulling c843e09 on jonves:master into 485b827 on racer-rust:master.

@Wilfred
Copy link
Member

Wilfred commented Dec 24, 2016

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.

@coveralls
Copy link

coveralls commented Dec 25, 2016

Coverage Status

Coverage remained the same at 66.106% when pulling 4952491 on jonves:master into 485b827 on racer-rust:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 66.106% when pulling 4952491 on jonves:master into 485b827 on racer-rust:master.

@ghost
Copy link
Author

ghost commented Dec 25, 2016

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.

@Wilfred Wilfred merged commit 2602d5a into racer-rust:master Dec 27, 2016
@Wilfred
Copy link
Member

Wilfred commented Dec 27, 2016

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants