Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove sweep and mercury feature flags (#48329)
Max Brunsfeld203d03d405d6
diff --git a/Cargo.lock b/Cargo.lockindex 23098e0af83..6a8ba7c6676 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -15209,7 +15209,6 @@ dependencies = ["edit_prediction","edit_prediction_ui","editor",- "feature_flags","fs","futures 0.3.31","fuzzy",diff --git a/crates/edit_prediction/src/edit_prediction.rs b/crates/edit_prediction/src/edit_prediction.rsindex d71f8d066b7..0ce1b51fb48 100644--- a/crates/edit_prediction/src/edit_prediction.rs+++ b/crates/edit_prediction/src/edit_prediction.rs@@ -105,18 +105,6 @@ const LAST_CHANGE_GROUPING_TIME: Duration = Duration::from_secs(1);const ZED_PREDICT_DATA_COLLECTION_CHOICE: &str = "zed_predict_data_collection_choice";const REJECT_REQUEST_DEBOUNCE: Duration = Duration::from_secs(15);-pub struct SweepFeatureFlag;--impl FeatureFlag for SweepFeatureFlag {- const NAME: &str = "sweep-ai";-}--pub struct MercuryFeatureFlag;--impl FeatureFlag for MercuryFeatureFlag {- const NAME: &str = "mercury";-}-static EDIT_PREDICTIONS_MODEL_ID: LazyLock<Option<String>> =LazyLock::new(|| env::var("ZED_ZETA_MODEL").ok());diff --git a/crates/edit_prediction_ui/src/edit_prediction_button.rs b/crates/edit_prediction_ui/src/edit_prediction_button.rsindex a64e3b62c1c..7344f8e4bf4 100644--- a/crates/edit_prediction_ui/src/edit_prediction_button.rs+++ b/crates/edit_prediction_ui/src/edit_prediction_button.rs@@ -3,9 +3,7 @@ use client::{Client, UserStore, zed_urls};use cloud_llm_client::UsageLimit;use codestral::CodestralEditPredictionDelegate;use copilot::Status;-use edit_prediction::{- EditPredictionStore, MercuryFeatureFlag, SweepFeatureFlag, Zeta2FeatureFlag,-};+use edit_prediction::{EditPredictionStore, Zeta2FeatureFlag};use edit_prediction_types::EditPredictionDelegateHandle;use editor::{Editor, MultiBufferOffset, SelectionEffects, actions::ShowEditPrediction, scroll::Autoscroll,@@ -1366,18 +1364,16 @@ pub fn get_available_providers(cx: &mut App) -> Vec<EditPredictionProvider> {providers.push(EditPredictionProvider::Ollama);}- if cx.has_flag::<SweepFeatureFlag>()- && edit_prediction::sweep_ai::sweep_api_token(cx)- .read(cx)- .has_key()+ if edit_prediction::sweep_ai::sweep_api_token(cx)+ .read(cx)+ .has_key(){providers.push(EditPredictionProvider::Sweep);}- if cx.has_flag::<MercuryFeatureFlag>()- && edit_prediction::mercury::mercury_api_token(cx)- .read(cx)- .has_key()+ if edit_prediction::mercury::mercury_api_token(cx)+ .read(cx)+ .has_key(){providers.push(EditPredictionProvider::Mercury);}diff --git a/crates/settings_ui/Cargo.toml b/crates/settings_ui/Cargo.tomlindex 717099f1938..2e8ce3aa252 100644--- a/crates/settings_ui/Cargo.toml+++ b/crates/settings_ui/Cargo.toml@@ -26,7 +26,6 @@ copilot_ui.workspace = trueedit_prediction.workspace = trueedit_prediction_ui.workspace = trueeditor.workspace = true-feature_flags.workspace = truefs.workspace = truefutures.workspace = truefuzzy.workspace = truediff --git a/crates/settings_ui/src/pages/edit_prediction_provider_setup.rs b/crates/settings_ui/src/pages/edit_prediction_provider_setup.rsindex 1cbd56f5ab9..b88a355d677 100644--- a/crates/settings_ui/src/pages/edit_prediction_provider_setup.rs+++ b/crates/settings_ui/src/pages/edit_prediction_provider_setup.rs@@ -1,10 +1,9 @@use edit_prediction::{- ApiKeyState, MercuryFeatureFlag, SweepFeatureFlag,+ ApiKeyState,mercury::{MERCURY_CREDENTIALS_URL, mercury_api_token},sweep_ai::{SWEEP_CREDENTIALS_URL, sweep_api_token},};use edit_prediction_ui::{get_available_providers, set_completion_provider};-use feature_flags::FeatureFlagAppExt as _;use gpui::{Entity, ScrollHandle, prelude::*};use language::language_settings::AllLanguageSettings;use language_models::provider::mistral::{CODESTRAL_API_URL, codestral_api_key};@@ -29,7 +28,7 @@ pub(crate) fn render_edit_prediction_setup_page(let providers = [Some(render_provider_dropdown(window, cx)),render_github_copilot_provider(window, cx).map(IntoElement::into_any_element),- cx.has_flag::<MercuryFeatureFlag>().then(|| {+ Some(render_api_key_provider(IconName::Inception,"Mercury",@@ -40,9 +39,9 @@ pub(crate) fn render_edit_prediction_setup_page(window,cx,)- .into_any_element()- }),- cx.has_flag::<SweepFeatureFlag>().then(|| {+ .into_any_element(),+ ),+ Some(render_api_key_provider(IconName::SweepAi,"Sweep",@@ -62,8 +61,8 @@ pub(crate) fn render_edit_prediction_setup_page(window,cx,)- .into_any_element()- }),+ .into_any_element(),+ ),Some(render_ollama_provider(settings_window, window, cx).into_any_element()),Some(render_api_key_provider(diff --git a/crates/zed/src/zed/edit_prediction_registry.rs b/crates/zed/src/zed/edit_prediction_registry.rsindex f13ae32c51f..ff4234ec2c5 100644--- a/crates/zed/src/zed/edit_prediction_registry.rs+++ b/crates/zed/src/zed/edit_prediction_registry.rs@@ -2,9 +2,7 @@ use client::{Client, UserStore};use codestral::CodestralEditPredictionDelegate;use collections::HashMap;use copilot::CopilotEditPredictionDelegate;-use edit_prediction::{- MercuryFeatureFlag, SweepFeatureFlag, ZedEditPredictionDelegate, Zeta2FeatureFlag,-};+use edit_prediction::{ZedEditPredictionDelegate, Zeta2FeatureFlag};use editor::Editor;use feature_flags::FeatureFlagAppExt;use gpui::{AnyWindowHandle, App, AppContext as _, Context, Entity, WeakEntity};@@ -204,10 +202,10 @@ fn assign_edit_prediction_provider({let has_model = ep_store.update(cx, |ep_store, cx| {let model = match value {- EditPredictionProvider::Sweep if cx.has_flag::<SweepFeatureFlag>() => {+ EditPredictionProvider::Sweep => {edit_prediction::EditPredictionModel::Sweep}- EditPredictionProvider::Mercury if cx.has_flag::<MercuryFeatureFlag>() => {+ EditPredictionProvider::Mercury => {edit_prediction::EditPredictionModel::Mercury}EditPredictionProvider::Ollama => {