VS Code 配置 Rust-Analyzer 报错

报错信息:

Bootstrap Error" rust-analyzer requires glibc >= 2.28 in latest build.

参考了好多地方,

https://github.com/rust-lang/rust-analyzer/issues/11558

https://blog.csdn.net/aLingYun/article/details/120923694

https://rust-analyzer.github.io/manual.html#vs-code

内容:

Summary of a workaround

the last working build: 0.2.948

the first broken build: 0.2.956

who is affected: anyone running Ubuntu < v.20
Option 1 - downgrade

1.Open the extension page in VS Code

  1. Click on V next to Uninstall button

  2. Select 0.2.948 and reload
    Notes

You will be perpetually stuck on that version.
Option 2 - use pre-prelease via rustup

Install rust-analyzer-preview by running rustup toolchain install nightly --component rust-analyzer-preview

Go to VSCode settings and search for rust-analyzer.server.path. You should see something along these lines

image

Click on Edit in settings.json and add "rust-analyzer.server.path": "~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer"

Reload VSCode
Notes

You will have to update the extension manually with rustup update

Even if rust-analyzer is built using nightly you can still use stable as your default channel

Component availability: https://rust-lang.github.io/rustup-components-history/

是把rust-analyzer 安装上了,但设置路径这一步一直不起效果。

最后偷梁换柱的方式成功了,用自己下载rust-analyzer 替换了VSCode 的 rust-analyzer ,成功了。

bash 复制代码
 $  ln -s ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rust-analyzer ~/.vscode-server/extensions/rust-lang.rust-analyzer-0.3.1566-linux-x64/server/rust-analyzer

后面发现,其实是应该该这里的文件 🤦‍。同样起作用。

相关推荐
SamDeepThinking3 分钟前
CyclicBarrier的底层实现
java·后端·面试
god_cvz3 分钟前
第二章:6、对话记忆与引用标注
后端·ai编程
拖孩3 分钟前
全程 AI 写的小程序,刚接上会员虚拟支付,上线第二天就有人真金白银买单了|双签名、定价、iOS 的坑我全踩了一遍
前端·后端·微信小程序
我是人✓4 分钟前
SpringMVC异常处理与拦截器实战揭秘
java·开发语言·后端
仟里码5 分钟前
九:goroutine(1.什么是协程)
后端
不是万能的豆学长14 分钟前
排查Go服务40天后的内存泄漏问题
开发语言·后端·golang·go
阿狗童鞋15 分钟前
SpringSecurity权限认证实战指南
java·后端·spring
码匠许师傅17 分钟前
【C++三方组件】libpqxx:PostgreSQL 的 C++ 客户端
开发语言·c++·postgresql
韩振方18 分钟前
Kubernetes Service 让会更换的 Pod 有稳定访问入口
后端
用户1257585243618 分钟前
Golang后台管理框架推荐:XYGo Admin与devinggo怎么选?
后端·go·ai编程