From 14cb96ec0e6be3b99bfe4ea373c058dcbd2a4f79 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 19:54:16 +0200 Subject: Allign RecordPat with RecordExpr --- crates/ra_ide_db/src/defs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide_db') diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index df56f2d9e..6bf80a34c 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs @@ -131,7 +131,7 @@ pub fn classify_name(sema: &Semantics, name: &ast::Name) -> Option ast::BindPat(it) => { let local = sema.to_def(&it)?; - if let Some(record_field_pat) = it.syntax().parent().and_then(ast::RecordFieldPat::cast) { + if let Some(record_field_pat) = it.syntax().parent().and_then(ast::RecordPatField::cast) { if record_field_pat.name_ref().is_none() { if let Some(field) = sema.resolve_record_field_pat(&record_field_pat) { let field = Definition::Field(field); @@ -247,7 +247,7 @@ pub fn classify_name_ref( } } - if let Some(record_field_pat) = ast::RecordFieldPat::cast(parent.clone()) { + if let Some(record_field_pat) = ast::RecordPatField::cast(parent.clone()) { if let Some(field) = sema.resolve_record_field_pat(&record_field_pat) { let field = Definition::Field(field); return Some(NameRefClass::Definition(field)); -- cgit v1.2.3 From 98181087984157e27faba0b969e384f3c62c39d5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:09:09 +0200 Subject: Rename BindPat -> IdentPat --- crates/ra_ide_db/src/defs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide_db') diff --git a/crates/ra_ide_db/src/defs.rs b/crates/ra_ide_db/src/defs.rs index 6bf80a34c..66c048714 100644 --- a/crates/ra_ide_db/src/defs.rs +++ b/crates/ra_ide_db/src/defs.rs @@ -111,7 +111,7 @@ pub fn classify_name(sema: &Semantics, name: &ast::Name) -> Option let parent = name.syntax().parent()?; - if let Some(bind_pat) = ast::BindPat::cast(parent.clone()) { + if let Some(bind_pat) = ast::IdentPat::cast(parent.clone()) { if let Some(def) = sema.resolve_bind_pat_to_const(&bind_pat) { return Some(NameClass::ConstReference(Definition::ModuleDef(def))); } @@ -128,7 +128,7 @@ pub fn classify_name(sema: &Semantics, name: &ast::Name) -> Option Some(NameClass::Definition(name_ref_class.definition())) }, - ast::BindPat(it) => { + ast::IdentPat(it) => { let local = sema.to_def(&it)?; if let Some(record_field_pat) = it.syntax().parent().and_then(ast::RecordPatField::cast) { -- cgit v1.2.3