Skip to content

Commit 1491013

Browse files
committed
Auto merge of rust-lang#12228 - Veykril:configfix, r=Veykril
fix: Fix old config patching overwriting callable snippet config unconditionally
2 parents 135164f + 252ffbf commit 1491013

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ impl Config {
595595
.collect();
596596
patch_old_style::patch_json_for_outdated_configs(&mut json);
597597
self.data = ConfigData::from_json(json, &mut errors);
598+
tracing::debug!("deserialized config data: {:#?}", self.data);
598599
self.snippets.clear();
599600
for (name, def) in self.data.completion_snippets_custom.iter() {
600601
if def.prefix.is_empty() && def.postfix.is_empty() {

crates/rust-analyzer/src/config/patch_old_style.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ pub(super) fn patch_json_for_outdated_configs(json: &mut Value) {
117117
) {
118118
(Some(Value::Bool(true)), Some(Value::Bool(true))) => json!("fill_arguments"),
119119
(Some(Value::Bool(true)), _) => json!("add_parentheses"),
120-
(_, _) => json!(null),
120+
(Some(Value::Bool(false)), Some(Value::Bool(false))) => json!("add_parentheses"),
121+
(_, _) => return,
121122
};
122123
merge(json, json!({ "completion": { "callable": {"snippets": res }} }));
123124
}

0 commit comments

Comments
 (0)