Settings refactor (#38367)
Co-Authored-By: Ben K <ben@zed.dev> Co-Authored-By: Anthony <anthony@zed.dev> Co-Authored-By: Mikayla <mikayla@zed.dev> Release Notes: - settings: Major internal changes to settings. The primary user-facing effect is that some settings which did not make sense in project settings files are no-longer read from there. (For example the inline blame settings) --------- Co-authored-by: Ben Kunkle <ben@zed.dev> Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com> Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
co-authored by
Ben Kunkle
Mikayla Maki
Anthony
parent
0a9023bce0
commit
fcdab160f9
@@ -924,7 +924,7 @@ mod tests {
|
||||
set_context_server_configuration(
|
||||
vec![(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Extension {
|
||||
settings::ContextServerSettingsContent::Extension {
|
||||
enabled: true,
|
||||
settings: json!({
|
||||
"somevalue": false
|
||||
@@ -943,7 +943,7 @@ mod tests {
|
||||
set_context_server_configuration(
|
||||
vec![(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Extension {
|
||||
settings::ContextServerSettingsContent::Extension {
|
||||
enabled: true,
|
||||
settings: json!({
|
||||
"somevalue": false
|
||||
@@ -970,7 +970,7 @@ mod tests {
|
||||
vec![
|
||||
(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Extension {
|
||||
settings::ContextServerSettingsContent::Extension {
|
||||
enabled: true,
|
||||
settings: json!({
|
||||
"somevalue": false
|
||||
@@ -979,7 +979,7 @@ mod tests {
|
||||
),
|
||||
(
|
||||
server_2_id.0.clone(),
|
||||
ContextServerSettings::Custom {
|
||||
settings::ContextServerSettingsContent::Custom {
|
||||
enabled: true,
|
||||
command: ContextServerCommand {
|
||||
path: "somebinary".into(),
|
||||
@@ -1011,7 +1011,7 @@ mod tests {
|
||||
vec![
|
||||
(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Extension {
|
||||
settings::ContextServerSettingsContent::Extension {
|
||||
enabled: true,
|
||||
settings: json!({
|
||||
"somevalue": false
|
||||
@@ -1020,7 +1020,7 @@ mod tests {
|
||||
),
|
||||
(
|
||||
server_2_id.0.clone(),
|
||||
ContextServerSettings::Custom {
|
||||
settings::ContextServerSettingsContent::Custom {
|
||||
enabled: true,
|
||||
command: ContextServerCommand {
|
||||
path: "somebinary".into(),
|
||||
@@ -1047,7 +1047,7 @@ mod tests {
|
||||
set_context_server_configuration(
|
||||
vec![(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Extension {
|
||||
settings::ContextServerSettingsContent::Extension {
|
||||
enabled: true,
|
||||
settings: json!({
|
||||
"somevalue": false
|
||||
@@ -1070,7 +1070,7 @@ mod tests {
|
||||
set_context_server_configuration(
|
||||
vec![(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Extension {
|
||||
settings::ContextServerSettingsContent::Extension {
|
||||
enabled: true,
|
||||
settings: json!({
|
||||
"somevalue": false
|
||||
@@ -1156,7 +1156,7 @@ mod tests {
|
||||
set_context_server_configuration(
|
||||
vec![(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Custom {
|
||||
settings::ContextServerSettingsContent::Custom {
|
||||
enabled: false,
|
||||
command: ContextServerCommand {
|
||||
path: "somebinary".into(),
|
||||
@@ -1185,7 +1185,7 @@ mod tests {
|
||||
set_context_server_configuration(
|
||||
vec![(
|
||||
server_1_id.0.clone(),
|
||||
ContextServerSettings::Custom {
|
||||
settings::ContextServerSettingsContent::Custom {
|
||||
enabled: true,
|
||||
command: ContextServerCommand {
|
||||
path: "somebinary".into(),
|
||||
@@ -1203,18 +1203,17 @@ mod tests {
|
||||
}
|
||||
|
||||
fn set_context_server_configuration(
|
||||
context_servers: Vec<(Arc<str>, ContextServerSettings)>,
|
||||
context_servers: Vec<(Arc<str>, settings::ContextServerSettingsContent)>,
|
||||
cx: &mut TestAppContext,
|
||||
) {
|
||||
cx.update(|cx| {
|
||||
SettingsStore::update_global(cx, |store, cx| {
|
||||
let mut settings = ProjectSettings::default();
|
||||
for (id, config) in context_servers {
|
||||
settings.context_servers.insert(id, config);
|
||||
}
|
||||
store
|
||||
.set_user_settings(&serde_json::to_string(&settings).unwrap(), cx)
|
||||
.unwrap();
|
||||
store.update_user_settings(cx, |content| {
|
||||
content.project.context_servers.clear();
|
||||
for (id, config) in context_servers {
|
||||
content.project.context_servers.insert(id, config);
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user