Set edit predictions to default to the Zed provider (#27394)

Release Notes:

- Changed the default edit prediction provider from Copilot to Zed
This commit is contained in:
Mikayla Maki 2025-03-24 20:45:06 -07:00 committed by GitHub
parent ffa736e566
commit 42f01cc903
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 43 deletions

View file

@ -6,9 +6,7 @@ use editor::{
scroll::Autoscroll,
Editor,
};
use feature_flags::{
FeatureFlagAppExt, PredictEditsFeatureFlag, PredictEditsRateCompletionsFeatureFlag,
};
use feature_flags::{FeatureFlagAppExt, PredictEditsRateCompletionsFeatureFlag};
use fs::Fs;
use gpui::{
actions, div, pulsating_between, Action, Animation, AnimationExt, App, AsyncWindowContext,
@ -232,10 +230,6 @@ impl Render for InlineCompletionButton {
}
EditPredictionProvider::Zed => {
if !cx.has_flag::<PredictEditsFeatureFlag>() {
return div();
}
let enabled = self.editor_enabled.unwrap_or(true);
let zeta_icon = if enabled {
@ -258,7 +252,7 @@ impl Render for InlineCompletionButton {
return div().child(
IconButton::new("zed-predict-pending-button", zeta_icon)
.shape(IconButtonShape::Square)
.indicator(Indicator::dot().color(Color::Error))
.indicator(Indicator::dot().color(Color::Muted))
.indicator_border_color(Some(cx.theme().colors().status_bar_background))
.tooltip(move |window, cx| {
Tooltip::with_meta(

View file

@ -2,7 +2,6 @@ use client::{Client, UserStore};
use collections::HashMap;
use copilot::{Copilot, CopilotCompletionProvider};
use editor::{Editor, EditorMode};
use feature_flags::{FeatureFlagAppExt, PredictEditsFeatureFlag};
use gpui::{AnyWindowHandle, App, AppContext as _, Context, Entity, WeakEntity};
use language::language_settings::{all_language_settings, EditPredictionProvider};
use settings::SettingsStore;
@ -71,23 +70,8 @@ pub fn init(client: Arc<Client>, user_store: Entity<UserStore>, cx: &mut App) {
});
}
if cx.has_flag::<PredictEditsFeatureFlag>() {
cx.on_action(clear_zeta_edit_history);
}
cx.observe_flag::<PredictEditsFeatureFlag, _>({
let editors = editors.clone();
let client = client.clone();
let user_store = user_store.clone();
move |active, cx| {
let provider = all_language_settings(None, cx).edit_predictions.provider;
assign_edit_prediction_providers(&editors, provider, &client, user_store.clone(), cx);
if active && !cx.is_action_available(&zeta::ClearHistory) {
cx.on_action(clear_zeta_edit_history);
}
}
})
.detach();
cx.on_action(clear_zeta_edit_history);
assign_edit_prediction_providers(&editors, provider, &client, user_store.clone(), cx);
cx.observe_global::<SettingsStore>({
let editors = editors.clone();
@ -249,9 +233,7 @@ fn assign_edit_prediction_provider(
}
}
EditPredictionProvider::Zed => {
if cx.has_flag::<PredictEditsFeatureFlag>()
|| (cfg!(debug_assertions) && client.status().borrow().is_connected())
{
if client.status().borrow().is_connected() {
let mut worktree = None;
if let Some(buffer) = &singleton_buffer {

View file

@ -1,9 +1,7 @@
use std::any::{Any, TypeId};
use command_palette_hooks::CommandPaletteFilter;
use feature_flags::{
FeatureFlagAppExt as _, PredictEditsFeatureFlag, PredictEditsRateCompletionsFeatureFlag,
};
use feature_flags::{FeatureFlagAppExt as _, PredictEditsRateCompletionsFeatureFlag};
use gpui::actions;
use language::language_settings::{AllLanguageSettings, EditPredictionProvider};
use settings::update_settings_file;
@ -24,16 +22,14 @@ pub fn init(cx: &mut App) {
workspace.register_action(
move |workspace, _: &zed_actions::OpenZedPredictOnboarding, window, cx| {
if cx.has_flag::<PredictEditsFeatureFlag>() {
ZedPredictModal::toggle(
workspace,
workspace.user_store().clone(),
workspace.client().clone(),
workspace.app_state().fs.clone(),
window,
cx,
)
}
ZedPredictModal::toggle(
workspace,
workspace.user_store().clone(),
workspace.client().clone(),
workspace.app_state().fs.clone(),
window,
cx,
)
},
);