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

[full] add bash auto-complete for cargo #216

Merged
merged 1 commit into from
Apr 28, 2020
Merged

Conversation

JesterOrNot
Copy link

This adds badly needed autocompletion for the cargo command

Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, and agreed! 👍 Thanks a lot @JesterOrNot.

However, if you look just 5 lines below, you'll see this line:

&& .cargo/bin/rustup completions bash | sudo tee /etc/bash_completion.d/rustup.bash-completion > /dev/null \

I think it would be better to just add "cargo" to that line. 😇

full/Dockerfile Outdated
@@ -263,7 +263,7 @@ RUN cp /home/gitpod/.profile /home/gitpod/.profile_orig && \
rls \
rust-analysis \
rust-src \
&& .cargo/bin/rustup completions bash | sudo tee /etc/bash_completion.d/rustup.bash-completion > /dev/null \
&& .cargo/bin/rustup completions bash cargo | sudo tee /etc/bash_completion.d/rustup.bash-completion > /dev/null \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my bad, it seems that rustup completions bash cargo actually only outputs completions for cargo, and that you still need to use rustup completions bash separately.

@JesterOrNot Could you please double-check?

In case both are needed, we could do it like this:

Suggested change
&& .cargo/bin/rustup completions bash cargo | sudo tee /etc/bash_completion.d/rustup.bash-completion > /dev/null \
&& .cargo/bin/rustup completions bash | sudo tee /etc/bash_completion.d/rustup.bash-completion > /dev/null \
&& .cargo/bin/rustup completions bash cargo | sudo tee /etc/bash_completion.d/rustup.cargo-bash-completion > /dev/null \

Copy link
Contributor

@jankeromnes jankeromnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, looks good to me! 👍

Thanks @JesterOrNot

@JesterOrNot
Copy link
Author

Thanks, merging! 🚀

@JesterOrNot JesterOrNot merged commit 6552f03 into master Apr 28, 2020
@JesterOrNot JesterOrNot deleted the sh/cargo-completions branch April 28, 2020 14:55
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.

2 participants