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/src/inlay_hints.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src/inlay_hints.rs') diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 4bbbcd258..1bacead63 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs @@ -78,7 +78,7 @@ pub(crate) fn inlay_hints( match node { ast::CallExpr(it) => { get_param_name_hints(&mut res, &sema, config, ast::Expr::from(it)); }, ast::MethodCallExpr(it) => { get_param_name_hints(&mut res, &sema, config, ast::Expr::from(it)); }, - ast::BindPat(it) => { get_bind_pat_hints(&mut res, &sema, config, it); }, + ast::IdentPat(it) => { get_bind_pat_hints(&mut res, &sema, config, it); }, _ => (), } } @@ -161,7 +161,7 @@ fn get_param_name_hints( Either::Left(self_param) => Some((self_param.to_string(), arg)), Either::Right(pat) => { let param_name = match pat { - ast::Pat::BindPat(it) => it.name()?.to_string(), + ast::Pat::IdentPat(it) => it.name()?.to_string(), it => it.to_string(), }; Some((param_name, arg)) @@ -182,7 +182,7 @@ fn get_bind_pat_hints( acc: &mut Vec, sema: &Semantics, config: &InlayHintsConfig, - pat: ast::BindPat, + pat: ast::IdentPat, ) -> Option<()> { if !config.type_hints { return None; @@ -202,7 +202,7 @@ fn get_bind_pat_hints( Some(()) } -fn pat_is_enum_variant(db: &RootDatabase, bind_pat: &ast::BindPat, pat_ty: &Type) -> bool { +fn pat_is_enum_variant(db: &RootDatabase, bind_pat: &ast::IdentPat, pat_ty: &Type) -> bool { if let Some(Adt::Enum(enum_data)) = pat_ty.as_adt() { let pat_text = bind_pat.to_string(); enum_data @@ -215,7 +215,11 @@ fn pat_is_enum_variant(db: &RootDatabase, bind_pat: &ast::BindPat, pat_ty: &Type } } -fn should_not_display_type_hint(db: &RootDatabase, bind_pat: &ast::BindPat, pat_ty: &Type) -> bool { +fn should_not_display_type_hint( + db: &RootDatabase, + bind_pat: &ast::IdentPat, + pat_ty: &Type, +) -> bool { if pat_ty.is_unknown() { return true; } -- cgit v1.2.3