Skip to main content

spawn_blocking_on_lsp_runtime

Function spawn_blocking_on_lsp_runtime 

Source
pub fn spawn_blocking_on_lsp_runtime<F, R>(f: F) -> JoinHandle<R> ⓘ
where F: FnOnce() -> R + Send + 'static, R: Send + 'static,
Expand description

IN.8b: the blocking sibling of spawn_on_lsp_runtime, for work that is genuinely synchronous rather than merely off-thread — spawning a formatter and waiting on its pipes.

spawn_blocking rather than spawn because a Command + wait_with_output would occupy a runtime worker for the whole run; on a current_thread runtime that is the actor thread, which is the no-UI-thread-work rule violated by a different route.