解决rust-analyzer加载时间过长等问题

温馨提示:最新内容仅在原文更新。

若出现下述类似的问题,可以尝试使用本文的方法进行解决。

  1. vscode 一直卡在 fetching metadata 阶段

  2. 出现报错 Blocking waiting for file lock on package cache

  3. 出现报错 proc macro command not expanded: No proc-macros present for crate rust-analyzer(unresolved-proc-macro)

  4. 出现报错 ERROR FetchBuildDataError: error: the --keep-going flag is unstable, and only available on the nightly channel of Cargo, but this is the stable channel See https://doc.xxxx-xxxx.org/book/appendix-07-nightly-rust.html for more information about Rust release channels. See https://xxxx.com/rust-lang/cargo/issues/10496 for more information about the --keep-going flag.

配置国内源

  • 参考文章 https://blog.zyxm.top/archives/rust-proxy-turbo

出现 1、2 可以尝试下述方法:

删除cargo的缓存

rm -rf ~/.cargo/.package-cache

执行 cargo metadata

重启 VSCode

出现 3、4 可以尝试下述方法:

尝试更新Rust版本

  • rustup --version 查看rustup版本

  • rustup toolchain list 查看已安装的版本

  • rustup default 【指定版本的名称】 切换到指定版本要更新Rust,可以使用以下命令:4

  • rustup update 升级所有安装的版本

  • rustup install stable 安装最新的稳定版

  • rustup install beta 安装最新的测试版

  • rustup install nightly 安装最新的每日构建版

重启 VSCode

原文地址

解决rust-analyzer加载时间过长

解决rust-analyzer加载时间过长(备用)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

开源分享汇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值