I'm trying Zed editor to develop Rust project and it work perfectly except one annoying thing: I can't configure Rust Analyzer to run checks when I type, like it does in VS Code. In Zed Rust Analyzer re-checks only on save and I can't find anywhere how to configure it to do this on the fly when I type. Anybody knows how to do this?
I'm trying Zed editor to develop Rust project and it work perfectly except one annoying thing: I can't configure Rust Analyzer to run checks when I type, like it does in VS Code. In Zed Rust Analyzer re-checks only on save and I can't find anywhere how to configure it to do this on the fly when I type. Anybody knows how to do this?
Share Improve this question asked Feb 1 at 10:37 yesintyesint 2131 silver badge11 bronze badges 2- Are you sure that's what it does in VS Code? My VS Code also only updates on save. Maybe there's a config option I don't know about though. – Finomnis Commented Feb 1 at 14:48
- 1 rust-analyzer only has check on save, although maybe you had autosave enabled. – Chayim Friedman Commented Feb 1 at 16:47
1 Answer
Reset to default 1Checking, as in cargo check
, which runs the compiler to obtain diagnostics, can only run against saved files — there is no protocol by which rust-analyzer can give Cargo unsaved files. However, rust-analyzer also has a subset of diagnostics implemented internally which are able to update as you type. These diagnostics largely attempt to mimic rustc diagnostics, though they are marked as being from rust-analyzer (at least in VS Code; I don’t use Zed myself).
rust-analyzer built-in diagnostics are controlled by the settings named rust-analyzer.diagnostics.*
. Check to make sure you don’t have them disabled.