Skip to content

Commit 846cefa

Browse files
committed
fix textedit range returned for completion when left token is a keyword
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
1 parent 0e814a3 commit 846cefa

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

crates/ra_ide/src/completion/complete_unqualified_path.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ mod tests {
299299

300300
#[test]
301301
fn completes_bindings_from_for_with_in_prefix() {
302+
mark::check!(completes_bindings_from_for_with_in_prefix);
302303
assert_debug_snapshot!(
303304
do_reference_completion(
304305
r"

crates/ra_ide/src/completion/completion_context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use ra_syntax::{
1212
use ra_text_edit::Indel;
1313

1414
use crate::{call_info::ActiveParameter, completion::CompletionConfig, FilePosition};
15+
use test_utils::mark;
1516

1617
/// `CompletionContext` is created early during completion to figure out, where
1718
/// exactly is the cursor, syntax-wise.
@@ -174,6 +175,7 @@ impl<'a> CompletionContext<'a> {
174175
if self.token.kind().is_keyword()
175176
&& self.offset == self.original_token.text_range().end()
176177
{
178+
mark::hit!(completes_bindings_from_for_with_in_prefix);
177179
TextRange::empty(self.original_token.text_range().start())
178180
} else {
179181
TextRange::empty(self.offset)

0 commit comments

Comments
 (0)