diff options
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/completion/complete_unqualified_path.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs index efde9bf73..0b0da6ee4 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ra_ide/src/completion/complete_unqualified_path.rs | |||
@@ -3,7 +3,7 @@ | |||
3 | use crate::completion::{CompletionContext, Completions}; | 3 | use crate::completion::{CompletionContext, Completions}; |
4 | 4 | ||
5 | pub(super) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionContext) { | 5 | pub(super) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionContext) { |
6 | if !(ctx.is_trivial_path && !ctx.is_pat_binding_or_const) { | 6 | if !(ctx.is_trivial_path && !ctx.is_pat_binding_or_const && !ctx.record_lit_syntax.is_some()) { |
7 | return; | 7 | return; |
8 | } | 8 | } |
9 | 9 | ||
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 6637afaf7..14a4a14d7 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -227,7 +227,7 @@ impl<'a> CompletionContext<'a> { | |||
227 | self.name_ref_syntax = | 227 | self.name_ref_syntax = |
228 | find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); | 228 | find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); |
229 | let name_range = name_ref.syntax().text_range(); | 229 | let name_range = name_ref.syntax().text_range(); |
230 | if name_ref.syntax().parent().and_then(ast::RecordField::cast).is_some() { | 230 | if ast::RecordField::for_field_name(&name_ref).is_some() { |
231 | self.record_lit_syntax = | 231 | self.record_lit_syntax = |
232 | self.sema.find_node_at_offset_with_macros(&original_file, offset); | 232 | self.sema.find_node_at_offset_with_macros(&original_file, offset); |
233 | } | 233 | } |