diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_dot.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_dot.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs index e1c0d26c7..fb8b2fc88 100644 --- a/crates/ra_ide_api/src/completion/complete_dot.rs +++ b/crates/ra_ide_api/src/completion/complete_dot.rs | |||
@@ -31,7 +31,7 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) | |||
31 | for field in s.fields(ctx.db) { | 31 | for field in s.fields(ctx.db) { |
32 | CompletionItem::new( | 32 | CompletionItem::new( |
33 | CompletionKind::Reference, | 33 | CompletionKind::Reference, |
34 | ctx.leaf_range(), | 34 | ctx.source_range(), |
35 | field.name().to_string(), | 35 | field.name().to_string(), |
36 | ) | 36 | ) |
37 | .kind(CompletionItemKind::Field) | 37 | .kind(CompletionItemKind::Field) |
@@ -45,9 +45,13 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) | |||
45 | } | 45 | } |
46 | Ty::Tuple(fields) => { | 46 | Ty::Tuple(fields) => { |
47 | for (i, _ty) in fields.iter().enumerate() { | 47 | for (i, _ty) in fields.iter().enumerate() { |
48 | CompletionItem::new(CompletionKind::Reference, ctx.leaf_range(), i.to_string()) | 48 | CompletionItem::new( |
49 | .kind(CompletionItemKind::Field) | 49 | CompletionKind::Reference, |
50 | .add_to(acc); | 50 | ctx.source_range(), |
51 | i.to_string(), | ||
52 | ) | ||
53 | .kind(CompletionItemKind::Field) | ||
54 | .add_to(acc); | ||
51 | } | 55 | } |
52 | } | 56 | } |
53 | _ => {} | 57 | _ => {} |
@@ -61,7 +65,7 @@ fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty | |||
61 | if sig.has_self_param() { | 65 | if sig.has_self_param() { |
62 | CompletionItem::new( | 66 | CompletionItem::new( |
63 | CompletionKind::Reference, | 67 | CompletionKind::Reference, |
64 | ctx.leaf_range(), | 68 | ctx.source_range(), |
65 | sig.name().to_string(), | 69 | sig.name().to_string(), |
66 | ) | 70 | ) |
67 | .from_function(ctx, func) | 71 | .from_function(ctx, func) |