rust-lang / rust-lang/rust-analyzer
SIGKILL on cargo-check crashes all open windows of VSCode
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: rust-analyzer version: 0.3.1885-standalone (b6d1887bc 2024-03-17)
rustc version: rustc 1.77.0 (aedd173a2 2024-03-17)
relevant settings: Linux (Debian)
If cargo-check gets sigkilled, which can happen if there is a proc macro with an infinite loop, the entire backend process of VSCode gets killed (instead of only cargo-check). This is very annoying if you are writing proc macros and accidentally write an infinite loop, especially since RA runs cargo-check on startup. If the setting cargo-check on save is disabled, it still seems to find a way to run the proc macro.
code snippet to reproduce:
#[proc_macro]
fn my_macro(_: TokenStream) -> TokenStream {
loop {}
}
// somewhere else
my_macro!()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the proc-macro snippet and inspect how cargo-check is launched and terminated by the rust-analyzer backend. The fix is complete when a SIGKILL from cargo-check does not terminate the VSCode backend, including when cargo-check runs on startup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100