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

Release Notes:

- N/A
This commit is contained in:
Thorsten Ball 2024-04-16 18:53:57 +02:00 committed by GitHub
parent c1c8a74c7f
commit c015b5c4cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 4 deletions

View file

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

View file

@ -18,7 +18,10 @@ use language::{
language_settings::{AllLanguageSettings, InlayHintSettings}, language_settings::{AllLanguageSettings, InlayHintSettings},
FakeLspAdapter, FakeLspAdapter,
}; };
use project::SERVER_PROGRESS_DEBOUNCE_TIMEOUT; use project::{
project_settings::{InlineBlameSettings, ProjectSettings},
SERVER_PROGRESS_DEBOUNCE_TIMEOUT,
};
use rpc::RECEIVE_TIMEOUT; use rpc::RECEIVE_TIMEOUT;
use serde_json::json; use serde_json::json;
use settings::SettingsStore; 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_a.update(editor::init);
cx_b.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 client_a
.fs() .fs()

View file

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