Clean up environment loading a bit (#28356)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-04-08 22:16:35 -04:00 committed by GitHub
parent b687a5e56d
commit f0b7f355a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 100 additions and 101 deletions

View file

@ -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;