Skip to content

Commit

Permalink
Move language loading to background thread as well
Browse files Browse the repository at this point in the history
  • Loading branch information
osiewicz committed Dec 2, 2024
1 parent 84b190c commit 35e5bf7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions crates/project/src/toolchain_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,14 @@ impl LocalToolchainStore {
})
.ok()?
.await;
let language = registry.language_for_name(&language_name.0).await.ok()?;
let toolchains = language.toolchain_lister()?;
Some(
cx.background_executor()
.spawn(async move { toolchains.list(root.to_path_buf(), project_env).await })
.await,
)

cx.background_executor()
.spawn(async move {
let language = registry.language_for_name(&language_name.0).await.ok()?;
let toolchains = language.toolchain_lister()?;
Some(toolchains.list(root.to_path_buf(), project_env).await)
})
.await
})
}
pub(crate) fn active_toolchain(
Expand Down

0 comments on commit 35e5bf7

Please sign in to comment.