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/completion/completion_context.rs | 2 +- crates/ra_ide/src/completion/patterns.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/completion') diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 29955754c..6b03b30bb 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -275,7 +275,7 @@ impl<'a> CompletionContext<'a> { // Otherwise, see if this is a declaration. We can use heuristics to // suggest declaration names, see `CompletionKind::Magic`. if let Some(name) = find_node_at_offset::(&file_with_fake_ident, offset) { - if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { + if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::IdentPat::cast) { self.is_pat_binding_or_const = true; if bind_pat.at_token().is_some() || bind_pat.ref_token().is_some() diff --git a/crates/ra_ide/src/completion/patterns.rs b/crates/ra_ide/src/completion/patterns.rs index 9e654b373..7c4feff6d 100644 --- a/crates/ra_ide/src/completion/patterns.rs +++ b/crates/ra_ide/src/completion/patterns.rs @@ -44,7 +44,7 @@ fn test_has_block_expr_parent() { } pub(crate) fn has_bind_pat_parent(element: SyntaxElement) -> bool { - element.ancestors().find(|it| it.kind() == BIND_PAT).is_some() + element.ancestors().find(|it| it.kind() == IDENT_PAT).is_some() } #[test] fn test_has_bind_pat_parent() { -- cgit v1.2.3