Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
welcome: Try Zed Edit Prediction (#24876)
Agus Zubiaga4aae0e2f6cd6
diff --git a/Cargo.lock b/Cargo.lockindex cd45aca3209..1c251aa0c50 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -15489,12 +15489,12 @@ version = "0.1.0"dependencies = ["anyhow","client",- "copilot","db","editor","fuzzy","gpui","install_cli",+ "language","picker","project","schemars",diff --git a/crates/welcome/Cargo.toml b/crates/welcome/Cargo.tomlindex a17e41e4493..75797733105 100644--- a/crates/welcome/Cargo.toml+++ b/crates/welcome/Cargo.toml@@ -17,18 +17,18 @@ test-support = [][dependencies]anyhow.workspace = trueclient.workspace = true-copilot.workspace = truedb.workspace = truefuzzy.workspace = truegpui.workspace = trueinstall_cli.workspace = true+language.workspace = truepicker.workspace = trueproject.workspace = trueschemars.workspace = trueserde.workspace = truesettings.workspace = true-ui.workspace = truetelemetry.workspace = true+ui.workspace = trueutil.workspace = truevim_mode_setting.workspace = trueworkspace.workspace = truediff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rsindex 7b4ae729bd6..5e8e4ff314a 100644--- a/crates/welcome/src/welcome.rs+++ b/crates/welcome/src/welcome.rs@@ -8,6 +8,7 @@ use gpui::{actions, svg, Action, App, Context, Entity, EventEmitter, FocusHandle, Focusable,InteractiveElement, ParentElement, Render, Styled, Subscription, Task, WeakEntity, Window,};+use language::language_settings::{all_language_settings, EditPredictionProvider};use settings::{Settings, SettingsStore};use std::sync::Arc;use ui::{prelude::*, CheckboxWithLabel, ElevationIndex, Tooltip};@@ -73,6 +74,16 @@ pub struct WelcomePage {impl Render for WelcomePage {fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {+ let edit_prediction_provider_is_zed =+ all_language_settings(None, cx).edit_predictions.provider+ == EditPredictionProvider::Zed;++ let edit_prediction_label = if edit_prediction_provider_is_zed {+ "Edit Prediction Enabled"+ } else {+ "Try Edit Prediction"+ };+h_flex().size_full().bg(cx.theme().colors().editor_background)@@ -161,17 +172,18 @@ impl Render for WelcomePage {).child(Button::new(- "sign-in-to-copilot",- "Sign in to GitHub Copilot",+ "try-zed-edit-prediction",+ edit_prediction_label,)- .icon(IconName::Copilot)+ .disabled(edit_prediction_provider_is_zed)+ .icon(IconName::ZedPredict).icon_size(IconSize::XSmall).icon_color(Color::Muted).icon_position(IconPosition::Start).on_click(cx.listener(|_, _, window, cx| {- telemetry::event!("Welcome Copilot Signed In");- copilot::initiate_sign_in(window, cx);+ telemetry::event!("Welcome Screen Try Edit Prediction clicked");+ window.dispatch_action(zed_actions::OpenZedPredictOnboarding.boxed_clone(), cx);}),),)