Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get real time cargo check editing experience without "manually check on save"? #10119

Closed
Wyvern opened this issue Sep 2, 2021 · 2 comments

Comments

@Wyvern
Copy link

Wyvern commented Sep 2, 2021

Hi, I previously used rust official extension, it could always check / watch my editing .rs files and give results immediately.

After switch to rust-analyzer I lost this capability, always need "check on save"; it's not good for general users.

Is there a way to get always check function, or how to config/set to activate it?

@bjorn3
Copy link
Member

bjorn3 commented Sep 2, 2021

Duplicate of #3107

tl;dr: rls used an unstable compiler api to provide rustc with the contents of the files as provided by the editor. Rust-analyzer doesn't use unstable api's, so it has to use cargo check, which requires the files to be saved on the disk.

@bjorn3 bjorn3 closed this as completed Sep 2, 2021
@lnicola
Copy link
Member

lnicola commented Sep 2, 2021

Syntax errors and other diagnostics are already refreshed during editing. If you want the full rustc diagnostics set, you can save periodically, or you can configure your editor to save the files automatically (at the cost of some CPU usage).

Full on-the-fly diagnostics are tracked in #3107.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants