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

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

相关推荐
java—大象1 分钟前
基于JavaWeb开发的java+Springboot操作系统教学交流平台详细设计实现
java·开发语言·spring boot
晴子呀25 分钟前
Spring底层原理大致脉络
java·后端·spring
DreamByte26 分钟前
Python Tkinter小程序
开发语言·python·小程序
覆水难收呀35 分钟前
三、(JS)JS中常见的表单事件
开发语言·前端·javascript
阿华的代码王国39 分钟前
【JavaEE】多线程编程引入——认识Thread类
java·开发语言·数据结构·mysql·java-ee
繁依Fanyi1 小时前
828 华为云征文|华为 Flexus 云服务器部署 RustDesk Server,打造自己的远程桌面服务器
运维·服务器·开发语言·人工智能·pytorch·华为·华为云
andrew_12191 小时前
腾讯 IEG 游戏前沿技术 二面复盘
后端·sql·面试
Lill_bin1 小时前
JVM内部结构解析
jvm·后端·spring cloud·微服务·云原生·ribbon
weixin_486681141 小时前
C++系列-STL容器中统计算法count, count_if
开发语言·c++·算法
基德爆肝c语言1 小时前
C++入门
开发语言·c++