-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Pass --bin
to cargo check
when a binary is changed
#17829
Comments
Which rust-analyzer version are you using with your helix setup? (wanna make sure whether its vscode specific or your helix r-a is just too old) |
Also running |
I used Rust-Analyzer as the component installed by I disabled Rust-Analyzer and ran
The one changed showed a changed timestamp which is expected. I don't see why Rust-Analyzer thinks that everything is invalid. |
In case this is helpful, I copied the logs of Helix after saving a file:
As you can see, it takes 10 seconds in the Windowns VM with 2 CPUs until the checks are done although nothing was changed, only a file save was triggered. In case you try to reproduce it: The effect isn't dramatic if Rust-Analyzer is running on bare metal with 16 threads. It is bad if someone has an older PC. |
Maybe there is no invalidation problem here. When I run @Veykril Does Rust-Analyzer run |
Ye I think you are right, there is no invalidation here. By default we run check with |
I just tried setting |
--bin
to cargo check
when a binary is changed
We won't change the default for this, as imo that is a worse default than what we have there right now. We do have a Though given all of these are binaries you are raising an interesting point, |
(Though that will require some bigger changes to the flychecking infra unfortunately) |
@alibektas Since you assigned yourself: Did you already start working on it? I wanted to try implementing it myself and start tomorrow if you don't mind. Otherwise, I would be happy to review (if my review counts). |
@mo8it I tried one or two things myself but I don't really have anything concrete atm. If you want to implement it yourself I have nothing against it. But let me also offer that I can try getting it done today and if I can't you can take over. How does that sound? |
@alibektas Sounds good! I won't be able to start before tomorrow night anyway ;) |
@mo8it 👋 I happened to solve this issue while working on a similar one. I want to honor my promise and let you submit the PR, but if you don't have anything ready yet, I could make the PR instead. Let me know what you think. |
Nice! No, go ahead. I didn't find time for it 😅 |
I marked this as important because it affects Rust beginners and I don't want them to get a bad expression while learning with Rustlings. It causes Rustlings to freeze for a long time because Rust-Analyzer blocks Cargo.
The issue is described here with a video: rust-lang/rustlings#2071
I was able to reproduce it in VS-Code in a Windows 10 VM (probably not a Windows problem, didn't test on Linux).
You don't even need to have Rustlings running in the background to see how Rust-Analyzer rebuilds everything on every file save:
rustlings inti
rustlings/
directoryIt looks like an issue in the Rust-Analyzer VS-Code plugin because it doesn't happen in Helix in the same VM.The effect probably became more dramatic after I added
--keep-going
in #17561The text was updated successfully, but these errors were encountered: