Skip to content

Commit a16d63c

Browse files
committed
Auto merge of #17488 - alibektas:17485/duplicate_snippets, r=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 #17485
2 parents 7cf4cc7 + f93d2dd commit a16d63c

File tree

1 file changed

+3
-0
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,9 @@ impl Config {
844844
config.source_root_parent_map = source_root_map;
845845
}
846846

847+
// IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`.
848+
config.snippets.clear();
849+
847850
let snips = self.completion_snippets_custom().to_owned();
848851

849852
for (name, def) in snips.iter() {

0 commit comments

Comments
 (0)