fix: attribute config precedence in JSON

This commit is contained in:
bellman
2026-06-03 23:47:27 +09:00
parent bcc5bfde9c
commit 94be902ce1
6 changed files with 345 additions and 58 deletions

View File

@@ -8654,6 +8654,30 @@ fn config_file_report_json(file: &ConfigFileReport) -> serde_json::Value {
serde_json::Value::String(source.to_string()),
);
object.insert("loaded".to_string(), serde_json::Value::Bool(file.loaded));
object.insert(
"precedence_rank".to_string(),
serde_json::Value::Number(serde_json::Number::from(file.precedence_rank)),
);
object.insert(
"wins_for_keys".to_string(),
serde_json::Value::Array(
file.wins_for_keys
.iter()
.cloned()
.map(serde_json::Value::String)
.collect(),
),
);
object.insert(
"shadowed_keys".to_string(),
serde_json::Value::Array(
file.shadowed_keys
.iter()
.cloned()
.map(serde_json::Value::String)
.collect(),
),
);
object.insert(
"status".to_string(),
serde_json::Value::String(file.status.as_str().to_string()),