diff options
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/patterns.rs | 2 |
2 files changed, 2 insertions, 2 deletions
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> { | |||
275 | // Otherwise, see if this is a declaration. We can use heuristics to | 275 | // Otherwise, see if this is a declaration. We can use heuristics to |
276 | // suggest declaration names, see `CompletionKind::Magic`. | 276 | // suggest declaration names, see `CompletionKind::Magic`. |
277 | if let Some(name) = find_node_at_offset::<ast::Name>(&file_with_fake_ident, offset) { | 277 | if let Some(name) = find_node_at_offset::<ast::Name>(&file_with_fake_ident, offset) { |
278 | if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { | 278 | if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::IdentPat::cast) { |
279 | self.is_pat_binding_or_const = true; | 279 | self.is_pat_binding_or_const = true; |
280 | if bind_pat.at_token().is_some() | 280 | if bind_pat.at_token().is_some() |
281 | || bind_pat.ref_token().is_some() | 281 | || 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() { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | pub(crate) fn has_bind_pat_parent(element: SyntaxElement) -> bool { | 46 | pub(crate) fn has_bind_pat_parent(element: SyntaxElement) -> bool { |
47 | element.ancestors().find(|it| it.kind() == BIND_PAT).is_some() | 47 | element.ancestors().find(|it| it.kind() == IDENT_PAT).is_some() |
48 | } | 48 | } |
49 | #[test] | 49 | #[test] |
50 | fn test_has_bind_pat_parent() { | 50 | fn test_has_bind_pat_parent() { |