zed-industries/zed · error

Setting formatters in both "format_on_save" and "formatter"

Error message

Setting formatters in both "format_on_save" and "formatter" is deprecated. Please migrate the formatters from {} into {}

What it means

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.

Source

Thrown at crates/migrator/src/migrations/m_2025_10_02/settings.rs:30

        return Ok(());
    };
    let Some(format_on_save) = obj.get("format_on_save").cloned() else {
        return Ok(());
    };
    let is_format_on_save_set_to_formatter = format_on_save.as_str().map_or(true, |s| {
        s != "on" && s != "off" && s != "modifications" && s != "modifications_if_available"
    });
    if !is_format_on_save_set_to_formatter {
        return Ok(());
    }

    fn fmt_path(path: &[&str], key: &str) -> String {
        let mut path = path.to_vec();
        path.push(key);
        path.join(".")
    }

    anyhow::ensure!(
        obj.get("formatter").is_none(),
        r#"Setting formatters in both "format_on_save" and "formatter" is deprecated. Please migrate the formatters from {} into {}"#,
        fmt_path(path, "format_on_save"),
        fmt_path(path, "formatter")
    );

    obj.insert("format_on_save".to_string(), serde_json::json!("on"));
    obj.insert("formatter".to_string(), format_on_save);

    Ok(())
}

View on GitHub (pinned to f4178619ac)

Solutions

  1. Edit settings.json to keep formatters only under "formatter" and set "format_on_save" to on/off
  2. Remove the nested formatter definitions from format_on_save
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/migrator/src/migrations/m_2025_10_02/settings.rs:30 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/11642b02c566b344. Report an issue: GitHub.