From cb7881ec0bc4075c3e3e581e7f86e0cee89d0a76 Mon Sep 17 00:00:00 2001 From: Ben Kunkle Date: Wed, 22 Oct 2025 11:17:01 -0700 Subject: [PATCH] Fix migration from #40409 for users who haven't been migrated yet (#40916) Closes #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 --- crates/migrator/src/migrations/m_2025_10_16/settings.rs | 2 +- crates/migrator/src/migrator.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/migrator/src/migrations/m_2025_10_16/settings.rs b/crates/migrator/src/migrations/m_2025_10_16/settings.rs index c9a8b7600cbf8842453318ed8dc9b47c3a73beaf..684a331af90ecd097376e629a3eb65a24d0609ae 100644 --- a/crates/migrator/src/migrations/m_2025_10_16/settings.rs +++ b/crates/migrator/src/migrations/m_2025_10_16/settings.rs @@ -58,7 +58,7 @@ fn restore_code_actions_on_format_inner(value: &mut Value, path: &[&str]) -> Res .map(|code_action| (code_action, Value::Bool(true))), ); - obj.remove("formatter"); + obj.insert("formatter".to_string(), Value::Array(vec![])); obj.insert( "code_actions_on_format".into(), Value::Object(code_actions_map), diff --git a/crates/migrator/src/migrator.rs b/crates/migrator/src/migrator.rs index e5f0c584c407284aa175a3ac33f3c9a9e01c1365..17cedaab666cd3ee53478456fbce8198ae65d8d2 100644 --- a/crates/migrator/src/migrator.rs +++ b/crates/migrator/src/migrator.rs @@ -2016,9 +2016,9 @@ mod tests { &r#"{ "code_actions_on_format": { "foo": true - } - } - "# + }, + "formatter": [] + }"# .unindent(), ), ); @@ -2053,6 +2053,7 @@ mod tests { .unindent(), Some( &r#"{ + "formatter": [], "code_actions_on_format": { "foo": true, "bar": true, @@ -2080,6 +2081,7 @@ mod tests { .unindent(), Some( &r#"{ + "formatter": [], "code_actions_on_format": { "foo": true, "qux": true,