tasks: Add ability to query active toolchains for languages (#20667)

Closes #18649

Release Notes:

- Python tasks now use active toolchain to run.
This commit is contained in:
Piotr Osiewicz 2024-11-14 14:37:37 +01:00 committed by GitHub
parent 04ba75e2e5
commit 89f9a506f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 170 additions and 103 deletions

View file

@ -85,13 +85,22 @@ impl HeadlessProject {
cx,
)
});
let environment = project::ProjectEnvironment::new(&worktree_store, None, cx);
let toolchain_store = cx.new_model(|cx| {
ToolchainStore::local(
languages.clone(),
worktree_store.clone(),
environment.clone(),
cx,
)
});
let task_store = cx.new_model(|cx| {
let mut task_store = TaskStore::local(
fs.clone(),
buffer_store.downgrade(),
worktree_store.clone(),
toolchain_store.read(cx).as_language_toolchain_store(),
environment.clone(),
cx,
);
@ -108,14 +117,7 @@ impl HeadlessProject {
observer.shared(SSH_PROJECT_ID, session.clone().into(), cx);
observer
});
let toolchain_store = cx.new_model(|cx| {
ToolchainStore::local(
languages.clone(),
worktree_store.clone(),
environment.clone(),
cx,
)
});
let lsp_store = cx.new_model(|cx| {
let mut lsp_store = LspStore::new_local(
buffer_store.clone(),