aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/search.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db/src/search.rs')
-rw-r--r--crates/ide_db/src/search.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide_db/src/search.rs b/crates/ide_db/src/search.rs
index 8e3dcd99c..a24335240 100644
--- a/crates/ide_db/src/search.rs
+++ b/crates/ide_db/src/search.rs
@@ -14,7 +14,7 @@ use syntax::{ast, match_ast, AstNode, TextRange, TextSize};
14 14
15use crate::defs::NameClass; 15use crate::defs::NameClass;
16use crate::{ 16use crate::{
17 defs::{classify_name, classify_name_ref, Definition, NameRefClass}, 17 defs::{Definition, NameRefClass},
18 RootDatabase, 18 RootDatabase,
19}; 19};
20 20
@@ -276,7 +276,7 @@ impl<'a> FindUsages<'a> {
276 name_ref: &ast::NameRef, 276 name_ref: &ast::NameRef,
277 sink: &mut dyn FnMut(Reference) -> bool, 277 sink: &mut dyn FnMut(Reference) -> bool,
278 ) -> bool { 278 ) -> bool {
279 match classify_name_ref(self.sema, &name_ref) { 279 match NameRefClass::classify(self.sema, &name_ref) {
280 Some(NameRefClass::Definition(def)) if &def == self.def => { 280 Some(NameRefClass::Definition(def)) if &def == self.def => {
281 let kind = if is_record_lit_name_ref(&name_ref) || is_call_expr_name_ref(&name_ref) 281 let kind = if is_record_lit_name_ref(&name_ref) || is_call_expr_name_ref(&name_ref)
282 { 282 {
@@ -292,7 +292,7 @@ impl<'a> FindUsages<'a> {
292 }; 292 };
293 sink(reference) 293 sink(reference)
294 } 294 }
295 Some(NameRefClass::FieldShorthand { local, field }) => { 295 Some(NameRefClass::FieldShorthand { local_ref: local, field_ref: field }) => {
296 let reference = match self.def { 296 let reference = match self.def {
297 Definition::Field(_) if &field == self.def => Reference { 297 Definition::Field(_) if &field == self.def => Reference {
298 file_range: self.sema.original_range(name_ref.syntax()), 298 file_range: self.sema.original_range(name_ref.syntax()),
@@ -313,10 +313,10 @@ impl<'a> FindUsages<'a> {
313 } 313 }
314 314
315 fn found_name(&self, name: &ast::Name, sink: &mut dyn FnMut(Reference) -> bool) -> bool { 315 fn found_name(&self, name: &ast::Name, sink: &mut dyn FnMut(Reference) -> bool) -> bool {
316 match classify_name(self.sema, name) { 316 match NameClass::classify(self.sema, name) {
317 Some(NameClass::FieldShorthand { local: _, field }) => { 317 Some(NameClass::PatFieldShorthand { local_def: _, field_ref }) => {
318 let reference = match self.def { 318 let reference = match self.def {
319 Definition::Field(_) if &field == self.def => Reference { 319 Definition::Field(_) if &field_ref == self.def => Reference {
320 file_range: self.sema.original_range(name.syntax()), 320 file_range: self.sema.original_range(name.syntax()),
321 kind: ReferenceKind::FieldShorthandForField, 321 kind: ReferenceKind::FieldShorthandForField,
322 // FIXME: mutable patterns should have `Write` access 322 // FIXME: mutable patterns should have `Write` access