Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 VSCode 中有 rust-analyzer 扩展。
在设置中,我只Rust-analyzer › Check On Save: Command从更改check为clippy(这无关紧要)。
Rust-analyzer › Check On Save: Command
check
clippy
问题是我在输入时没有看到错误,只有在我保存之后。
输入(无错误):
已保存(可以看到错误):
可以改变吗?
Rust-analyzer 不支持实时 linting(还没有?)。
简而言之,rust-analyzer 本质上是运行cargo check. 对于小型项目,这可能非常快。但是,随着项目规模的增加,这可能会花费更多时间,这使得实时检查变得不可行。
cargo check
另请参阅问题 #4185和“首次发布”帖子中的“缺点”。
您可以做的下一件最好的事情(如您所知)是使用“检查保存”:
"rust-analyzer.checkOnSave.enable": true
(在 VSCode 扩展中默认启用)