解决rust-analyzer加载时间过长等问题
若出现下述类似的问题,可以尝试使用本文的方法进行解决。
-
vscode 一直卡在
fetching metadata
阶段 -
出现报错
Blocking waiting for file lock on package cache
-
出现报错
proc macro command not expanded: No proc-macros present for crate rust-analyzer(unresolved-proc-macro)
-
出现报错
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.
配置国内源
出现 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
原文地址

作者:LiangSenCheng小森森 开源分享汇 公众号
出处:https://www.cnblogs.com/LiangSenCheng/p/18329861/rust-analyzer-timeout
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战