From 241a73df54865e9bc20ece628d800df6ec14909f Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:13:54 +0200 Subject: [PATCH] wip --- crates/language/src/language.rs | 1 + crates/language/src/toolchain.rs | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 crates/language/src/toolchain.rs diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs index c1c9cfebbe..2db5f083c0 100644 --- a/crates/language/src/language.rs +++ b/crates/language/src/language.rs @@ -15,6 +15,7 @@ mod outline; pub mod proto; mod syntax_map; mod task_context; +mod toolchain; #[cfg(test)] pub mod buffer_tests; diff --git a/crates/language/src/toolchain.rs b/crates/language/src/toolchain.rs new file mode 100644 index 0000000000..2ea19624d8 --- /dev/null +++ b/crates/language/src/toolchain.rs @@ -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, DefaultIndex);