rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
52.69k stars 10.02k forks source link

Add pending UI #2077

Closed senekor closed 1 month ago

senekor commented 1 month ago

This is a POC of this suggestion. It's a little hacky, but as far as I understand it will be removed again once the issue with rust-analyzer is fixed. I think removing it is a good idea, because rust-analyzer is working fine for me and the pending UI is only shown for a very short amount of time.

Also, I added the pending UI at the very bottom, because if rust-analyzer isn't running at all the UI becomes very janky if any of the other text changes or moves.

mo8it commented 1 month ago

Thanks, but there is no need to keep the a pending state. I solved by only adding this:

https://github.com/rust-lang/rustlings/blob/4ce8667b9d878dc48fafb665699a5fc71c190972/src/watch/state.rs#L54-L58

I will also keep it even after the Rust-Analyzer issue is resolved. It gives the user instant feedback which can be relevant on older PCs or with exercises with a long runtime.

senekor commented 1 month ago

Much better 👍