Clean up environment loading a bit (#28356)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
b687a5e56d
commit
f0b7f355a2
8 changed files with 100 additions and 101 deletions
|
@ -317,21 +317,14 @@ impl LocalToolchainStore {
|
|||
cx: &App,
|
||||
) -> Task<Option<ToolchainList>> {
|
||||
let registry = self.languages.clone();
|
||||
let Some(root) = self
|
||||
.worktree_store
|
||||
.read(cx)
|
||||
.worktree_for_id(path.worktree_id, cx)
|
||||
.map(|worktree| worktree.read(cx).abs_path())
|
||||
else {
|
||||
let Some(abs_path) = self.worktree_store.read(cx).absolutize(&path, cx) else {
|
||||
return Task::ready(None);
|
||||
};
|
||||
|
||||
let abs_path = root.join(path.path);
|
||||
let environment = self.project_environment.clone();
|
||||
cx.spawn(async move |cx| {
|
||||
let project_env = environment
|
||||
.update(cx, |environment, cx| {
|
||||
environment.get_environment(Some(root.clone()), cx)
|
||||
environment.get_directory_environment(abs_path.as_path().into(), cx)
|
||||
})
|
||||
.ok()?
|
||||
.await;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue