diff options
author | Aleksey Kladov <[email protected]> | 2020-04-11 15:42:24 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-11 18:20:41 +0100 |
commit | 7a39bc3ba29351feabcd4a16e12568a9e12818ca (patch) | |
tree | a5f102f40002dd66b4fc06aa2c3474f3be184a17 /crates/ra_ide | |
parent | e7a68c8f55e0770fdeae508a1710509c13aaffa1 (diff) |
Make records grammar more orthogonal
We used
name [: expr]
grammar before, now it is
[name :] expr
which makes things simpler
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 | } |