diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-09 17:54:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-09 17:54:14 +0100 |
commit | dde9488559514e7d039cec9407e1f8627f665cd0 (patch) | |
tree | 5ddc0361d4d3538b60cb63a645042cfdcd51f4c6 /crates/ra_ide/src/completion/completion_context.rs | |
parent | 4cea01fdf8dc0a647007bde3010f9fbe607f1e75 (diff) | |
parent | 2bfb65db93e48d8f9e8ecac0b2ea837c081a4db5 (diff) |
Merge #3919
3919: Refactor tokena accessors r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion/completion_context.rs')
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index f833d2a9a..0e34d85db 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -190,7 +190,10 @@ impl<'a> CompletionContext<'a> { | |||
190 | if let Some(name) = find_node_at_offset::<ast::Name>(&file_with_fake_ident, offset) { | 190 | if let Some(name) = find_node_at_offset::<ast::Name>(&file_with_fake_ident, offset) { |
191 | if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { | 191 | if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { |
192 | self.is_pat_binding_or_const = true; | 192 | self.is_pat_binding_or_const = true; |
193 | if bind_pat.has_at() || bind_pat.is_ref() || bind_pat.is_mutable() { | 193 | if bind_pat.at_token().is_some() |
194 | || bind_pat.ref_kw_token().is_some() | ||
195 | || bind_pat.mut_kw_token().is_some() | ||
196 | { | ||
194 | self.is_pat_binding_or_const = false; | 197 | self.is_pat_binding_or_const = false; |
195 | } | 198 | } |
196 | if bind_pat.syntax().parent().and_then(ast::RecordFieldPatList::cast).is_some() { | 199 | if bind_pat.syntax().parent().and_then(ast::RecordFieldPatList::cast).is_some() { |