Skip to content

Commit 74367b5

Browse files
probably-nebmikayla-maki
authored andcommitted
Fix migration from zed-industries#40409 for users who haven't been migrated yet (zed-industries#40916)
Closes zed-industries#40874 Release Notes: - Fixed an issue where migrating settings after v0.208.5+ would spuriously enable prettier. This fix only affects those who have not updated or migrated yet. For those who have already updated to version v0.208.5 or later, placing `"formatter": []` in your settings in the affected languages will fix the issue. --------- Co-authored-by: Mikayla <mikayla@zed.dev>
1 parent b357b3d commit 74367b5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

crates/migrator/src/migrations/m_2025_10_16/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn restore_code_actions_on_format_inner(value: &mut Value, path: &[&str]) -> Res
5858
.map(|code_action| (code_action, Value::Bool(true))),
5959
);
6060

61-
obj.remove("formatter");
61+
obj.insert("formatter".to_string(), Value::Array(vec![]));
6262
obj.insert(
6363
"code_actions_on_format".into(),
6464
Value::Object(code_actions_map),

crates/migrator/src/migrator.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,9 +2016,9 @@ mod tests {
20162016
&r#"{
20172017
"code_actions_on_format": {
20182018
"foo": true
2019-
}
2020-
}
2021-
"#
2019+
},
2020+
"formatter": []
2021+
}"#
20222022
.unindent(),
20232023
),
20242024
);
@@ -2053,6 +2053,7 @@ mod tests {
20532053
.unindent(),
20542054
Some(
20552055
&r#"{
2056+
"formatter": [],
20562057
"code_actions_on_format": {
20572058
"foo": true,
20582059
"bar": true,
@@ -2080,6 +2081,7 @@ mod tests {
20802081
.unindent(),
20812082
Some(
20822083
&r#"{
2084+
"formatter": [],
20832085
"code_actions_on_format": {
20842086
"foo": true,
20852087
"qux": true,

0 commit comments

Comments
 (0)