Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
assistant: Feature flag terminal inline assistant (#13732)
Bennet Bo Fenner51ee60b421ee
diff --git a/Cargo.lock b/Cargo.lockindex 1eea0088734..40e6a172400 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -382,6 +382,7 @@ dependencies = ["ctor","editor","env_logger",+ "feature_flags","file_icons","fs","futures 0.3.28",diff --git a/crates/assistant/Cargo.toml b/crates/assistant/Cargo.tomlindex ca96bd4bac1..a9397bf3c1e 100644--- a/crates/assistant/Cargo.toml+++ b/crates/assistant/Cargo.toml@@ -23,6 +23,7 @@ client.workspace = truecollections.workspace = truecommand_palette_hooks.workspace = trueeditor.workspace = true+feature_flags.workspace = truefile_icons.workspace = truefs.workspace = truefutures.workspace = truediff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rsindex a39c14d7bd5..9c169b98613 100644--- a/crates/assistant/src/assistant_panel.rs+++ b/crates/assistant/src/assistant_panel.rs@@ -462,6 +462,11 @@ impl AssistantPanel {.focus_handle(cx).contains_focused(cx){+ use feature_flags::FeatureFlagAppExt;+ if !cx.has_flag::<feature_flags::TerminalInlineAssist>() {+ return None;+ }+if let Some(terminal_view) = terminal_panel.read(cx).pane()diff --git a/crates/feature_flags/src/feature_flags.rs b/crates/feature_flags/src/feature_flags.rsindex 200468d6f32..0435f52c17c 100644--- a/crates/feature_flags/src/feature_flags.rs+++ b/crates/feature_flags/src/feature_flags.rs@@ -29,6 +29,11 @@ impl FeatureFlag for Remoting {const NAME: &'static str = "remoting";}+pub struct TerminalInlineAssist {}+impl FeatureFlag for TerminalInlineAssist {+ const NAME: &'static str = "terminal-inline-assist";+}+pub trait FeatureFlagViewExt<V: 'static> {fn observe_flag<T: FeatureFlag, F>(&mut self, callback: F) -> Subscriptionwhere