diff options
author | unexge <[email protected]> | 2021-04-03 22:04:31 +0100 |
---|---|---|
committer | unexge <[email protected]> | 2021-04-04 18:52:43 +0100 |
commit | 8d4be829e09dae4af7b4a82b379fdb8700b0929f (patch) | |
tree | 860e45f32fc34b5f443addd04583658118ad2daa /crates/ide_db | |
parent | d3a112d68c74cbd02630f6c909071c94872c193f (diff) |
Add convert tuple struct to named struct assist
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/search.rs | 18 |
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 { |