toolchains: Use language-specific terms in UI (#20985)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-11-21 15:57:22 +01:00 committed by GitHub
parent 75c545aa1e
commit 0b373d43dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 76 additions and 9 deletions

View file

@ -2,8 +2,8 @@ use anyhow::ensure;
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use collections::HashMap;
use gpui::AsyncAppContext;
use gpui::{AppContext, Task};
use gpui::{AsyncAppContext, SharedString};
use language::language_settings::language_settings;
use language::LanguageName;
use language::LanguageToolchainStore;
@ -498,8 +498,17 @@ fn python_module_name_from_relative_path(relative_path: &str) -> String {
.to_string()
}
#[derive(Default)]
pub(crate) struct PythonToolchainProvider {}
pub(crate) struct PythonToolchainProvider {
term: SharedString,
}
impl Default for PythonToolchainProvider {
fn default() -> Self {
Self {
term: SharedString::new_static("Virtual Environment"),
}
}
}
static ENV_PRIORITY_LIST: &'static [PythonEnvironmentKind] = &[
// Prioritize non-Conda environments.
@ -604,6 +613,9 @@ impl ToolchainLister for PythonToolchainProvider {
groups: Default::default(),
}
}
fn term(&self) -> SharedString {
self.term.clone()
}
}
pub struct EnvironmentApi<'a> {