Run the main thread under the User Interactive QoS class

This commit is contained in:
Luna Razzaghipour 2023-05-25 00:22:14 +10:00
parent 578d99477a
commit 430bdd3509
No known key found for this signature in database

View File

@ -78,7 +78,14 @@ fn try_main(flags: flags::RustAnalyzer) -> Result<()> {
println!("rust-analyzer {}", rust_analyzer::version());
return Ok(());
}
with_extra_thread("LspServer", stdx::thread::QoSClass::Utility, run_server)?;
// rust-analyzers “main thread” is actually a secondary thread
// with an increased stack size at the User Initiated QoS class.
// We use this QoS class because any delay in the main loop
// will make actions like hitting enter in the editor slow.
// rust-analyzer does not block the editors render loop,
// so we dont use User Interactive.
with_extra_thread("LspServer", stdx::thread::QoSClass::UserInitiated, run_server)?;
}
flags::RustAnalyzerCmd::Parse(cmd) => cmd.run()?,
flags::RustAnalyzerCmd::Symbols(cmd) => cmd.run()?,