Skip to content

Commit

Permalink
Auto merge of rust-lang#17488 - alibektas:17485/duplicate_snippets, r…
Browse files Browse the repository at this point in the history
…=alibektas

minor : Fix duplicate snippets showing up on hover.

With each `config::apply_change` duplicate configs were being added.
Now we first drain the vec that holds these and then start adding. This fixes rust-lang#17485
  • Loading branch information
bors committed Jun 24, 2024
2 parents 7cf4cc7 + f93d2dd commit a16d63c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,9 @@ impl Config {
config.source_root_parent_map = source_root_map;
}

// IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
config.snippets.clear();

let snips = self.completion_snippets_custom().to_owned();

for (name, def) in snips.iter() {
Expand Down

0 comments on commit a16d63c

Please sign in to comment.