【发布时间】:2023-02-26 19:22:56
【问题描述】:
我将 NeoVim 与 LSP Zero 插件 + Rust analyzer 一起用于 Rust 编程。
当我跳转到某个外部板条箱(包括std)中的定义时,Nvim 的诊断开始向我显示该板条箱中的所有错误。
例如,如果我只是通过 cargo init some_project 创建新项目,然后通过 nvim some_project 打开它并跳转到 println 宏的定义,诊断开始向我展示大量这样的东西:
/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/lib.rs|100 col 1-32 error| `#![feature]` may not be used on the stable release channel
/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/lib.rs|100 col 12-30 error| `#![feature]` may not be used on the stable release channel
/home/user/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/lib.rs|101 col 12-30 error| `#![feature]` may not be used on the stable release channel
我也尝试使用 CoC 而不是本地 LSP,但它没有改变任何东西。
什么是禁用当前工作区外的板条箱诊断的正确方法?
【问题讨论】:
标签: rust neovim language-server-protocol rust-analyzer