Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ep: Disable diagnostic based jumps (#58832)

Ben Kunklef87bcfa4a561
diff --git a/crates/edit_prediction/src/edit_prediction.rs b/crates/edit_prediction/src/edit_prediction.rs
index c177d23844d..4279b4e2c88 100644
--- a/crates/edit_prediction/src/edit_prediction.rs
+++ b/crates/edit_prediction/src/edit_prediction.rs
@@ -142,6 +142,10 @@ pub struct EditPredictionJumpsFeatureFlag;
impl FeatureFlag for EditPredictionJumpsFeatureFlag {
const NAME: &'static str = "edit_prediction_jumps";
type Value = PresenceFlag;
+
+ fn enabled_for_staff() -> bool {
+ false
+ }
}
register_feature_flag!(EditPredictionJumpsFeatureFlag);
diff --git a/crates/edit_prediction/src/edit_prediction_tests.rs b/crates/edit_prediction/src/edit_prediction_tests.rs
index 93427c5f316..78a3e2b00c4 100644
--- a/crates/edit_prediction/src/edit_prediction_tests.rs
+++ b/crates/edit_prediction/src/edit_prediction_tests.rs
@@ -55,6 +55,7 @@ use crate::{
#[gpui::test]
async fn test_current_state(cx: &mut TestAppContext) {
+ enable_edit_prediction_jumps(cx);
let (ep_store, mut requests) = init_test_with_fake_client(cx);
let fs = FakeFs::new(cx.executor());
fs.insert_tree(
@@ -197,15 +198,9 @@ async fn test_current_state(cx: &mut TestAppContext) {
#[gpui::test]
async fn test_diagnostics_refresh_suppressed_while_following(cx: &mut TestAppContext) {
+ enable_edit_prediction_jumps(cx);
let (ep_store, mut requests) = init_test_with_fake_client(cx);
- cx.update(|cx| {
- cx.update_flags(
- false,
- vec![EditPredictionJumpsFeatureFlag::NAME.to_string()],
- );
- });
-
let fs = FakeFs::new(cx.executor());
fs.insert_tree(
"/root",
@@ -369,15 +364,9 @@ async fn test_diagnostics_refresh_suppressed_while_following(cx: &mut TestAppCon
#[gpui::test]
async fn test_diagnostics_refresh_suppressed_after_agent_edit(cx: &mut TestAppContext) {
+ enable_edit_prediction_jumps(cx);
let (ep_store, mut requests) = init_test_with_fake_client(cx);
- cx.update(|cx| {
- cx.update_flags(
- false,
- vec![EditPredictionJumpsFeatureFlag::NAME.to_string()],
- );
- });
-
let fs = FakeFs::new(cx.executor());
fs.insert_tree(
"/root",
@@ -2079,6 +2068,7 @@ async fn test_cancel_second_on_third_request(cx: &mut TestAppContext) {
#[gpui::test]
async fn test_jump_and_edit_throttles_are_independent(cx: &mut TestAppContext) {
+ enable_edit_prediction_jumps(cx);
let (ep_store, mut requests) = init_test_with_fake_client(cx);
let fs = FakeFs::new(cx.executor());
@@ -2785,6 +2775,12 @@ fn assert_no_predict_request_ready(
}
}
+fn enable_edit_prediction_jumps(cx: &mut TestAppContext) {
+ cx.update(|cx| {
+ cx.update_flags(true, vec![EditPredictionJumpsFeatureFlag::NAME.to_string()]);
+ });
+}
+
fn update_test_diagnostics(
project: &Entity<Project>,
path: &str,