toolchains: Add support for relative paths (#27777)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 19:48:09 +02:00 committed by GitHub
parent 627ae7af6f
commit edf712d45b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 178 additions and 93 deletions

View file

@ -3065,7 +3065,7 @@ impl Project {
pub fn available_toolchains(
&self,
worktree_id: WorktreeId,
path: ProjectPath,
language_name: LanguageName,
cx: &App,
) -> Task<Option<ToolchainList>> {
@ -3074,7 +3074,7 @@ impl Project {
cx.update(|cx| {
toolchain_store
.read(cx)
.list_toolchains(worktree_id, language_name, cx)
.list_toolchains(path, language_name, cx)
})
.ok()?
.await
@ -3098,20 +3098,18 @@ impl Project {
pub fn activate_toolchain(
&self,
worktree_id: WorktreeId,
path: ProjectPath,
toolchain: Toolchain,
cx: &mut App,
) -> Task<Option<()>> {
let Some(toolchain_store) = self.toolchain_store.clone() else {
return Task::ready(None);
};
toolchain_store.update(cx, |this, cx| {
this.activate_toolchain(worktree_id, toolchain, cx)
})
toolchain_store.update(cx, |this, cx| this.activate_toolchain(path, toolchain, cx))
}
pub fn active_toolchain(
&self,
worktree_id: WorktreeId,
path: ProjectPath,
language_name: LanguageName,
cx: &App,
) -> Task<Option<Toolchain>> {
@ -3120,7 +3118,7 @@ impl Project {
};
toolchain_store
.read(cx)
.active_toolchain(worktree_id, language_name, cx)
.active_toolchain(path, language_name, cx)
}
pub fn language_server_statuses<'a>(
&'a self,