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

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

相关推荐
汤米粥几秒前
Python调用百度搜索触发安全验证
开发语言·python
阿维的博客日记6 分钟前
spring里面的@RequestParam什么意思
java·后端·spring
影寂ldy9 分钟前
C# 五大加密算法全套实战(AES/DES对称、RSA非对称、MD5/SHA256哈希)
开发语言·c#·哈希算法
金金金__13 分钟前
腾讯云COS接入配置
后端
Hyyy18 分钟前
Git Worktree 完全讲解
前端·后端·面试
罗超驿36 分钟前
6.Java LinkedList深度解析:从链表原理到源码实践
java·开发语言·链表
2501_9481069139 分钟前
计算机毕业设计之jsp物业管理系统
java·大数据·开发语言·汽车·课程设计
独孤留白1 小时前
从C到Rust:Mutex / RwLock / Atomic 跨线程局部可变性
rust
逝水无殇1 小时前
C# 反射详解
开发语言·后端·c#
Cache技术分享1 小时前
465. Java 反射 - 获取类的简单名
前端·后端