This commit is contained in:
Piotr Osiewicz
2024-10-16 00:13:54 +02:00
parent 498ecd6404
commit 241a73df54
2 changed files with 25 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ mod outline;
pub mod proto;
mod syntax_map;
mod task_context;
mod toolchain;
#[cfg(test)]
pub mod buffer_tests;

View File

@@ -0,0 +1,24 @@
//! Provides support for language toolchains.
//!
//! A language can have associated toolchains,
//! which is a set of tools used to interact with the projects written in said language.
//! For example, a Python project can have an associated virtual environment; a Rust project can have a toolchain override.
use gpui::SharedString;
/// Represents a single toolchain.
pub struct Toolchain {
/// User-facing label
pub label: SharedString,
/// Action that should be taken in order to activate a given toolchain.
pub action: (),
}
///
pub trait ToolchainLister {
fn list(&self) -> ToolchainList;
fn activate(&self, _: Toolchain);
}
type DefaultIndex = usize;
pub struct ToolchainList(Vec<Toolchain>, DefaultIndex);