{"record":{"id":"c1adacf5926e2ae9","repo":"zed-industries/zed","slug":"expected-auto-indent-to-be-a-boolean-or-valid-enum","errorCode":null,"errorMessage":"Expected auto_indent to be a boolean or valid enum value","messagePattern":"Expected auto_indent to be a boolean or valid enum value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/migrator/src/migrations/m_2025_01_27/settings.rs","lineNumber":24,"sourceCode":"pub fn make_auto_indent_an_enum(value: &mut Value) -> Result<()> {\n    migrate_language_setting(value, migrate_auto_indent)\n}\n\nfn migrate_auto_indent(value: &mut Value, _path: &[&str]) -> Result<()> {\n    let Some(auto_indent) = value\n        .as_object_mut()\n        .and_then(|obj| obj.get_mut(\"auto_indent\"))\n    else {\n        return Ok(());\n    };\n\n    *auto_indent = match auto_indent {\n        Value::Bool(true) => Value::String(\"syntax_aware\".to_string()),\n        Value::Bool(false) => Value::String(\"none\".to_string()),\n        Value::String(s) if s == \"syntax_aware\" || s == \"preserve_indent\" || s == \"none\" => {\n            return Ok(());\n        }\n        _ => anyhow::bail!(\"Expected auto_indent to be a boolean or valid enum value\"),\n    };\n    Ok(())\n}\n","sourceCodeStart":6,"sourceCodeEnd":28,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/migrator/src/migrations/m_2025_01_27/settings.rs#L6-L28","documentation":"Settings migration guard: auto_indent had a value that is neither Bool(true), Bool(false), nor one of the accepted legacy strings, so it cannot be mapped to the new enum representation. The user's settings.json (or a language override) contains a corrupt/unexpected auto_indent value.","triggerScenarios":"Thrown at crates/migrator/src/migrations/m_2025_01_27/settings.rs:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Edit settings.json and set auto_indent to a boolean or one of the valid enum values (e.g. \"syntax_aware\", \"none\")","Remove the auto_indent key to fall back to the default","Fix any JSON syntax errors around the setting"],"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-14T00:17:10.932Z"}