From a01cf8562700f3e5594f66daf40f31d9fe7ec570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 29 Dec 2021 17:18:21 +0100 Subject: [PATCH] fix(rust): use default toolchain when completing `cargo` --- plugins/rust/rust.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/rust/rust.plugin.zsh b/plugins/rust/rust.plugin.zsh index ced6eb4aa..014c73b3b 100644 --- a/plugins/rust/rust.plugin.zsh +++ b/plugins/rust/rust.plugin.zsh @@ -25,4 +25,7 @@ fi # Generate completion files in the background rustup completions zsh >| "$ZSH_CACHE_DIR/completions/_rustup" &| -rustup completions zsh cargo >| "$ZSH_CACHE_DIR/completions/_cargo" &| +cat >| "$ZSH_CACHE_DIR/completions/_cargo" <<'EOF' +#compdef cargo +source $(rustc +${${(z)$(rustup default)}[1]} --print sysroot)/share/zsh/site-functions/_cargo +EOF