diff --git a/Cargo.lock b/Cargo.lock
index 4d1ae4f58bcafffb65af23b5985c94fcd593bcb7..a21ab94b659510ad067071993fe5d0ae0f2db97a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -9837,7 +9837,7 @@ dependencies = [
"pretty_assertions",
"serde_json",
"serde_json_lenient",
- "settings",
+ "settings_json",
"streaming-iterator",
"tree-sitter",
"tree-sitter-json",
@@ -15260,6 +15260,7 @@ dependencies = [
"indoc",
"inventory",
"log",
+ "migrator",
"paths",
"pretty_assertions",
"release_channel",
@@ -15268,17 +15269,31 @@ dependencies = [
"serde",
"serde_json",
"serde_json_lenient",
- "serde_path_to_error",
"serde_repr",
"serde_with",
+ "settings_json",
"settings_macros",
"smallvec",
"strum 0.27.2",
+ "unindent",
+ "util",
+ "zlog",
+]
+
+[[package]]
+name = "settings_json"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "pretty_assertions",
+ "serde",
+ "serde_json",
+ "serde_json_lenient",
+ "serde_path_to_error",
"tree-sitter",
"tree-sitter-json",
"unindent",
"util",
- "zlog",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index d69d768f33eb59e9f2c6e3194a976e612d5944ab..50828f67afca2974fcc4149bec9cfe377b41553b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -148,6 +148,7 @@ members = [
"crates/semantic_version",
"crates/session",
"crates/settings",
+ "crates/settings_json",
"crates/settings_macros",
"crates/settings_profile_selector",
"crates/settings_ui",
@@ -380,6 +381,7 @@ search = { path = "crates/search" }
semantic_version = { path = "crates/semantic_version" }
session = { path = "crates/session" }
settings = { path = "crates/settings" }
+settings_json = { path = "crates/settings_json" }
settings_macros = { path = "crates/settings_macros" }
settings_ui = { path = "crates/settings_ui" }
snippet = { path = "crates/snippet" }
diff --git a/crates/migrator/Cargo.toml b/crates/migrator/Cargo.toml
index edb48a00e2ca93232d9022b6fb778449d2ecc7e4..e0a75784749c2d3a2a981b44cbbe449a7685c605 100644
--- a/crates/migrator/Cargo.toml
+++ b/crates/migrator/Cargo.toml
@@ -22,7 +22,7 @@ tree-sitter-json.workspace = true
tree-sitter.workspace = true
serde_json_lenient.workspace = true
serde_json.workspace = true
-settings.workspace = true
+settings_json.workspace = true
[dev-dependencies]
pretty_assertions.workspace = true
diff --git a/crates/migrator/src/migrator.rs b/crates/migrator/src/migrator.rs
index 28021042825988ee70c04993ca71c5e9abe86bb4..ff9635dcef7664b17eb02a03b7584ea18ac9a91b 100644
--- a/crates/migrator/src/migrator.rs
+++ b/crates/migrator/src/migrator.rs
@@ -15,6 +15,7 @@
//! You only need to write replacement logic for x-1 to x because you can be certain that, internally, every user will be at x-1, regardless of their on disk state.
use anyhow::{Context as _, Result};
+use settings_json::{infer_json_indent_size, parse_json_with_comments, update_value_in_json_text};
use std::{cmp::Reverse, ops::Range, sync::LazyLock};
use streaming_iterator::StreamingIterator;
use tree_sitter::{Query, QueryMatch};
@@ -74,7 +75,7 @@ fn run_migrations(text: &str, migrations: &[MigrationType]) -> Result