Skip to content

Commit 252ffbf

Browse files
committed
fix: Fix old config patching overwriting callable snippet config unconditionally
1 parent 135164f commit 252ffbf

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/rust-analyzer/src/config.rs

+1
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

+2-1
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)