{"record":{"id":"6ab168d1a84182d2","repo":"zed-industries/zed","slug":"the-code-actions-on-format-is-in-an-invalid-stat","errorCode":null,"errorMessage":"The `code_actions_on_format` is in an invalid state and cannot be migrated at {}. Please ensure the code_actions_on_format setting is a Map<String, bool>","messagePattern":"The `code_actions_on_format` is in an invalid state and cannot be migrated at (.+?)\\. Please ensure the code_actions_on_format setting is a Map<String, bool>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/migrator/src/migrations/m_2025_10_16/settings.rs","lineNumber":26,"sourceCode":"}\n\nfn restore_code_actions_on_format_inner(value: &mut Value, path: &[&str]) -> Result<()> {\n    let Some(obj) = value.as_object_mut() else {\n        return Ok(());\n    };\n    let code_actions_on_format = obj\n        .get(\"code_actions_on_format\")\n        .cloned()\n        .unwrap_or_else(|| Value::Object(Default::default()));\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    let Some(mut code_actions_map) = code_actions_on_format.as_object().cloned() else {\n        anyhow::bail!(\n            r#\"The `code_actions_on_format` is in an invalid state and cannot be migrated at {}. Please ensure the code_actions_on_format setting is a Map<String, bool>\"#,\n            fmt_path(path, \"code_actions_on_format\"),\n        );\n    };\n\n    let Some(formatter) = obj.get(\"formatter\") else {\n        return Ok(());\n    };\n    let formatter_array = if let Some(array) = formatter.as_array() {\n        array.clone()\n    } else {\n        vec![formatter.clone()]\n    };\n    if formatter_array.is_empty() {\n        return Ok(());\n    }\n    let mut code_action_formatters = Vec::new();\n    for formatter in formatter_array {","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/migrator/src/migrations/m_2025_10_16/settings.rs#L8-L44","documentation":"Migration guard: code_actions_on_format exists but is not a JSON object map of string keys to booleans, so the migration cannot rewrite it. The user's settings contain a malformed value (e.g. a string, array, or non-bool entries).","triggerScenarios":"Thrown at crates/migrator/src/migrations/m_2025_10_16/settings.rs:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open settings.json at the reported path and make code_actions_on_format an object mapping action names to booleans","Remove the invalid code_actions_on_format key and re-add it in the new format"],"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"}