{"record":{"id":"11642b02c566b344","repo":"zed-industries/zed","slug":"setting-formatters-in-both-format-on-save-and-f","errorCode":null,"errorMessage":"Setting formatters in both \"format_on_save\" and \"formatter\" is deprecated. Please migrate the formatters from {} into {}","messagePattern":"Setting formatters in both \"format_on_save\" and \"formatter\" is deprecated\\. Please migrate the formatters from (.+?) into (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/migrator/src/migrations/m_2025_10_02/settings.rs","lineNumber":30,"sourceCode":"        return Ok(());\n    };\n    let Some(format_on_save) = obj.get(\"format_on_save\").cloned() else {\n        return Ok(());\n    };\n    let is_format_on_save_set_to_formatter = format_on_save.as_str().map_or(true, |s| {\n        s != \"on\" && s != \"off\" && s != \"modifications\" && s != \"modifications_if_available\"\n    });\n    if !is_format_on_save_set_to_formatter {\n        return Ok(());\n    }\n\n    fn fmt_path(path: &[&str], key: &str) -> String {\n        let mut path = path.to_vec();\n        path.push(key);\n        path.join(\".\")\n    }\n\n    anyhow::ensure!(\n        obj.get(\"formatter\").is_none(),\n        r#\"Setting formatters in both \"format_on_save\" and \"formatter\" is deprecated. Please migrate the formatters from {} into {}\"#,\n        fmt_path(path, \"format_on_save\"),\n        fmt_path(path, \"formatter\")\n    );\n\n    obj.insert(\"format_on_save\".to_string(), serde_json::json!(\"on\"));\n    obj.insert(\"formatter\".to_string(), format_on_save);\n\n    Ok(())\n}\n","sourceCodeStart":12,"sourceCodeEnd":42,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/migrator/src/migrations/m_2025_10_02/settings.rs#L12-L42","documentation":"Settings migration guard (remove_formatters_on_save_inner): the user's settings assign formatters both via the deprecated format_on_save-as-object form and the modern formatter key, which is ambiguous; the migration refuses to proceed until the user consolidates them.","triggerScenarios":"Thrown at crates/migrator/src/migrations/m_2025_10_02/settings.rs:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Edit settings.json to keep formatters only under \"formatter\" and set \"format_on_save\" to on/off","Remove the nested formatter definitions from format_on_save"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}