aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db')
-rw-r--r--crates/ide_db/src/search.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ide_db/src/search.rs b/crates/ide_db/src/search.rs
index 02f5e514b..90e4e7b03 100644
--- a/crates/ide_db/src/search.rs
+++ b/crates/ide_db/src/search.rs
@@ -430,6 +430,15 @@ impl<'a> FindUsages<'a> {
430 sink: &mut dyn FnMut(FileId, FileReference) -> bool, 430 sink: &mut dyn FnMut(FileId, FileReference) -> bool,
431 ) -> bool { 431 ) -> bool {
432 match NameRefClass::classify(self.sema, &name_ref) { 432 match NameRefClass::classify(self.sema, &name_ref) {
433 Some(NameRefClass::Definition(def)) if &def == self.def => {
434 let FileRange { file_id, range } = self.sema.original_range(name_ref.syntax());
435 let reference = FileReference {
436 range,
437 name: ast::NameLike::NameRef(name_ref.clone()),
438 access: reference_access(&def, &name_ref),
439 };
440 sink(file_id, reference)
441 }
433 Some(NameRefClass::Definition(Definition::SelfType(impl_))) => { 442 Some(NameRefClass::Definition(Definition::SelfType(impl_))) => {
434 let ty = impl_.self_ty(self.sema.db); 443 let ty = impl_.self_ty(self.sema.db);
435 444
@@ -448,15 +457,6 @@ impl<'a> FindUsages<'a> {
448 457
449 false 458 false
450 } 459 }
451 Some(NameRefClass::Definition(def)) if &def == self.def => {
452 let FileRange { file_id, range } = self.sema.original_range(name_ref.syntax());
453 let reference = FileReference {
454 range,
455 name: ast::NameLike::NameRef(name_ref.clone()),
456 access: reference_access(&def, &name_ref),
457 };
458 sink(file_id, reference)
459 }
460 Some(NameRefClass::FieldShorthand { local_ref: local, field_ref: field }) => { 460 Some(NameRefClass::FieldShorthand { local_ref: local, field_ref: field }) => {
461 let FileRange { file_id, range } = self.sema.original_range(name_ref.syntax()); 461 let FileRange { file_id, range } = self.sema.original_range(name_ref.syntax());
462 let reference = match self.def { 462 let reference = match self.def {