From 6a06f6f724d385c61e428ef46e6bf9e13e1c37ce Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 7 Nov 2022 16:48:50 +0100 Subject: [PATCH] Deduplicate reference search results --- crates/ide/src/references.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index e942413c110..0f758cfa2d3 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -16,6 +16,7 @@ search::{ReferenceCategory, SearchScope, UsageSearchResult}, RootDatabase, }; +use itertools::Itertools; use stdx::hash::NoHashHashMap; use syntax::{ algo::find_node_at_offset, @@ -86,6 +87,7 @@ pub(crate) fn find_all_refs( file_id, refs.into_iter() .map(|file_ref| (file_ref.range, file_ref.category)) + .unique() .collect(), ) })