2

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?

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. Commented Feb 1 at 14:48
  • 1
    rust-analyzer only has check on save, although maybe you had autosave enabled. Commented Feb 1 at 16:47

1 Answer 1

1

Checking, 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.