mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
Auto merge of #13571 - Veykril:unique-references, r=Veykril
minor: Deduplicate reference search results Fixes https://github.com/rust-lang/rust-analyzer/issues/13407
This commit is contained in:
commit
a27e4dad37
1 changed files with 2 additions and 0 deletions
|
@ -16,6 +16,7 @@ use ide_db::{
|
|||
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(),
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue