diff options
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/completion/complete_dot.rs | 13 | ||||
-rw-r--r-- | crates/ra_ide/src/completion/completion_context.rs | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/crates/ra_ide/src/completion/complete_dot.rs b/crates/ra_ide/src/completion/complete_dot.rs index 22f5077f5..82ec16913 100644 --- a/crates/ra_ide/src/completion/complete_dot.rs +++ b/crates/ra_ide/src/completion/complete_dot.rs | |||
@@ -720,7 +720,18 @@ mod tests { | |||
720 | } | 720 | } |
721 | ", | 721 | ", |
722 | ), | 722 | ), |
723 | @r###"[]"### | 723 | @r###" |
724 | [ | ||
725 | CompletionItem { | ||
726 | label: "the_field", | ||
727 | source_range: [156; 156), | ||
728 | delete: [156; 156), | ||
729 | insert: "the_field", | ||
730 | kind: Field, | ||
731 | detail: "u32", | ||
732 | }, | ||
733 | ] | ||
734 | "### | ||
724 | ); | 735 | ); |
725 | } | 736 | } |
726 | 737 | ||
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 3646fb8dc..54589a2a8 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -135,7 +135,7 @@ impl<'a> CompletionContext<'a> { | |||
135 | ), | 135 | ), |
136 | ) { | 136 | ) { |
137 | let new_offset = hypothetical_expansion.1.text_range().start(); | 137 | let new_offset = hypothetical_expansion.1.text_range().start(); |
138 | if new_offset >= actual_expansion.text_range().end() { | 138 | if new_offset > actual_expansion.text_range().end() { |
139 | break; | 139 | break; |
140 | } | 140 | } |
141 | original_file = actual_expansion; | 141 | original_file = actual_expansion; |