Skip to content

Commit a364384

Browse files
committed
Sort the fields, so the diffs on the generated docs/schemas are smaller
1 parent f77b64c commit a364384

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,13 +2248,10 @@ macro_rules! _config_data {
22482248
$({
22492249
let field = stringify!($field);
22502250
let ty = stringify!($ty);
2251+
let default =
2252+
serde_json::to_string(&{ let default_: $ty = $default; default_ }).unwrap();
22512253

2252-
(
2253-
field,
2254-
ty,
2255-
&[$($doc),*],
2256-
serde_json::to_string(&{ let default_: $ty = $default; default_ }).unwrap(),
2257-
)
2254+
(field, ty, &[$($doc),*], default)
22582255
},)*
22592256
])
22602257
}
@@ -2309,6 +2306,8 @@ impl ConfigData {
23092306
GlobalConfigData::schema_fields(&mut fields);
23102307
LocalConfigData::schema_fields(&mut fields);
23112308
ClientConfigData::schema_fields(&mut fields);
2309+
// HACK: sort the fields, so the diffs on the generated docs/schema are smaller
2310+
fields.sort_by_key(|&(x, ..)| x);
23122311
fields
23132312
}
23142313

0 commit comments

Comments
 (0)