Enable inline-git-blame by default (#10632)

Thorsten Ball created

Release Notes:

- N/A

Change summary

assets/settings/default.json            |  4 ++--
crates/collab/src/tests/editor_tests.rs | 24 +++++++++++++++++++++++-
crates/project/src/project_settings.rs  |  7 ++++++-
3 files changed, 31 insertions(+), 4 deletions(-)

Detailed changes

assets/settings/default.json 🔗

@@ -172,7 +172,7 @@
   },
   // The number of lines to keep above/below the cursor when scrolling.
   "vertical_scroll_margin": 3,
-  // Scroll sensitivity multiplier. This multiplier is applied 
+  // Scroll sensitivity multiplier. This multiplier is applied
   // to both the horizontal and vertical delta values while scrolling.
   "scroll_sensitivity": 1.0,
   "relative_line_numbers": false,
@@ -398,7 +398,7 @@
     // Control whether the git blame information is shown inline,
     // in the currently focused line.
     "inline_blame": {
-      "enabled": false
+      "enabled": true
       // Sets a delay after which the inline blame information is shown.
       // Delay is restarted with every cursor movement.
       // "delay_ms": 600

crates/collab/src/tests/editor_tests.rs 🔗

@@ -18,7 +18,10 @@ use language::{
     language_settings::{AllLanguageSettings, InlayHintSettings},
     FakeLspAdapter,
 };
-use project::SERVER_PROGRESS_DEBOUNCE_TIMEOUT;
+use project::{
+    project_settings::{InlineBlameSettings, ProjectSettings},
+    SERVER_PROGRESS_DEBOUNCE_TIMEOUT,
+};
 use rpc::RECEIVE_TIMEOUT;
 use serde_json::json;
 use settings::SettingsStore;
@@ -1999,6 +2002,25 @@ async fn test_git_blame_is_forwarded(cx_a: &mut TestAppContext, cx_b: &mut TestA
 
     cx_a.update(editor::init);
     cx_b.update(editor::init);
+    // Turn inline-blame-off by default so no state is transferred without us explicitly doing so
+    let inline_blame_off_settings = Some(InlineBlameSettings {
+        enabled: false,
+        delay_ms: None,
+    });
+    cx_a.update(|cx| {
+        cx.update_global(|store: &mut SettingsStore, cx| {
+            store.update_user_settings::<ProjectSettings>(cx, |settings| {
+                settings.git.inline_blame = inline_blame_off_settings;
+            });
+        });
+    });
+    cx_b.update(|cx| {
+        cx.update_global(|store: &mut SettingsStore, cx| {
+            store.update_user_settings::<ProjectSettings>(cx, |settings| {
+                settings.git.inline_blame = inline_blame_off_settings;
+            });
+        });
+    });
 
     client_a
         .fs()

crates/project/src/project_settings.rs 🔗

@@ -71,7 +71,8 @@ pub struct InlineBlameSettings {
     /// Whether or not to show git blame data inline in
     /// the currently focused line.
     ///
-    /// Default: false
+    /// Default: true
+    #[serde(default = "true_value")]
     pub enabled: bool,
     /// Whether to only show the inline blame information
     /// after a delay once the cursor stops moving.
@@ -80,6 +81,10 @@ pub struct InlineBlameSettings {
     pub delay_ms: Option<u64>,
 }
 
+const fn true_value() -> bool {
+    true
+}
+
 #[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
 pub struct BinarySettings {
     pub path: Option<String>,