Skip to content

Commit fd2cb64

Browse files
authored
Merge pull request #18830 from alibektas/18814
fix: 18814
2 parents 9bc53ff + a0898b9 commit fd2cb64

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/rust-analyzer/src/config.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,11 +910,18 @@ impl Config {
910910

911911
patch_old_style::patch_json_for_outdated_configs(&mut json);
912912

913+
let mut json_errors = vec![];
914+
let snips = get_field_json::<FxHashMap<String, SnippetDef>>(
915+
&mut json,
916+
&mut json_errors,
917+
"completion_snippets_custom",
918+
None,
919+
)
920+
.unwrap_or(self.completion_snippets_custom().to_owned());
921+
913922
// IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
914923
config.snippets.clear();
915924

916-
let snips = self.completion_snippets_custom().to_owned();
917-
918925
for (name, def) in snips.iter() {
919926
if def.prefix.is_empty() && def.postfix.is_empty() {
920927
continue;

0 commit comments

Comments
 (0)