aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db/src/search.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_db/src/search.rs')
-rw-r--r--crates/ra_ide_db/src/search.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs
index 596f957b8..b464959fc 100644
--- a/crates/ra_ide_db/src/search.rs
+++ b/crates/ra_ide_db/src/search.rs
@@ -28,8 +28,8 @@ pub struct Reference {
28 28
29#[derive(Debug, Clone, PartialEq)] 29#[derive(Debug, Clone, PartialEq)]
30pub enum ReferenceKind { 30pub enum ReferenceKind {
31 StructFieldShorthandForField, 31 FieldShorthandForField,
32 StructFieldShorthandForLocal, 32 FieldShorthandForLocal,
33 StructLiteral, 33 StructLiteral,
34 Other, 34 Other,
35} 35}
@@ -242,14 +242,14 @@ impl Definition {
242 } 242 }
243 Some(NameRefClass::FieldShorthand { local, field }) => { 243 Some(NameRefClass::FieldShorthand { local, field }) => {
244 match self { 244 match self {
245 Definition::StructField(_) if &field == self => refs.push(Reference { 245 Definition::Field(_) if &field == self => refs.push(Reference {
246 file_range: sema.original_range(name_ref.syntax()), 246 file_range: sema.original_range(name_ref.syntax()),
247 kind: ReferenceKind::StructFieldShorthandForField, 247 kind: ReferenceKind::FieldShorthandForField,
248 access: reference_access(&field, &name_ref), 248 access: reference_access(&field, &name_ref),
249 }), 249 }),
250 Definition::Local(l) if &local == l => refs.push(Reference { 250 Definition::Local(l) if &local == l => refs.push(Reference {
251 file_range: sema.original_range(name_ref.syntax()), 251 file_range: sema.original_range(name_ref.syntax()),
252 kind: ReferenceKind::StructFieldShorthandForLocal, 252 kind: ReferenceKind::FieldShorthandForLocal,
253 access: reference_access(&Definition::Local(local), &name_ref), 253 access: reference_access(&Definition::Local(local), &name_ref),
254 }), 254 }),
255 255
@@ -267,7 +267,7 @@ impl Definition {
267fn reference_access(def: &Definition, name_ref: &ast::NameRef) -> Option<ReferenceAccess> { 267fn reference_access(def: &Definition, name_ref: &ast::NameRef) -> Option<ReferenceAccess> {
268 // Only Locals and Fields have accesses for now. 268 // Only Locals and Fields have accesses for now.
269 match def { 269 match def {
270 Definition::Local(_) | Definition::StructField(_) => {} 270 Definition::Local(_) | Definition::Field(_) => {}
271 _ => return None, 271 _ => return None,
272 }; 272 };
273 273