toolchains: Use language-specific terms in UI (#20985)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
75c545aa1e
commit
0b373d43dc
6 changed files with 76 additions and 9 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue