From 6145b1f34faeafa4519a2f6a3db420585655ed64 Mon Sep 17 00:00:00 2001 From: Ali Bektas Date: Mon, 24 Jun 2024 12:31:00 +0200 Subject: [PATCH 1/2] 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. --- src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs index e8504979bedaf..96e377d365161 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs @@ -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 = vec![]; + let snips = self.completion_snippets_custom().to_owned(); for (name, def) in snips.iter() { From f93d2ddb40d05499d822c8d57d386b876c758894 Mon Sep 17 00:00:00 2001 From: Ali Bektas Date: Mon, 24 Jun 2024 13:13:53 +0200 Subject: [PATCH 2/2] Apply minor changes --- src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs index 96e377d365161..8e302709aab71 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs @@ -845,7 +845,7 @@ impl Config { } // IMPORTANT : This holds as long as ` completion_snippets_custom` is declared `client`. - config.snippets = vec![]; + config.snippets.clear(); let snips = self.completion_snippets_custom().to_owned();