aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-15 17:54:18 +0000
committerAleksey Kladov <[email protected]>2019-01-15 17:54:18 +0000
commit8ba9c2d4cedbcf8f1d2c644733d2b06fa1984d22 (patch)
treea97af07a664ce4be35f6a16409eebd6706296fff /crates/ra_ide_api/src/completion
parentb871062e329301683083a1a2ff5eb476e6c397c7 (diff)
remove Cancelable from type inference
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r--crates/ra_ide_api/src/completion/complete_dot.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_dot.rs b/crates/ra_ide_api/src/completion/complete_dot.rs
index 30a0a3924..31a2478d1 100644
--- a/crates/ra_ide_api/src/completion/complete_dot.rs
+++ b/crates/ra_ide_api/src/completion/complete_dot.rs
@@ -9,7 +9,7 @@ pub(super) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) -> Ca
9 (Some(function), Some(receiver)) => (function, receiver), 9 (Some(function), Some(receiver)) => (function, receiver),
10 _ => return Ok(()), 10 _ => return Ok(()),
11 }; 11 };
12 let infer_result = function.infer(ctx.db)?; 12 let infer_result = function.infer(ctx.db);
13 let syntax_mapping = function.body_syntax_mapping(ctx.db); 13 let syntax_mapping = function.body_syntax_mapping(ctx.db);
14 let expr = match syntax_mapping.node_expr(receiver) { 14 let expr = match syntax_mapping.node_expr(receiver) {
15 Some(expr) => expr, 15 Some(expr) => expr,
@@ -19,7 +19,7 @@ pub(super) fn complete_dot(acc: &mut Completions, ctx: &CompletionContext) -> Ca
19 if !ctx.is_call { 19 if !ctx.is_call {
20 complete_fields(acc, ctx, receiver_ty.clone()); 20 complete_fields(acc, ctx, receiver_ty.clone());
21 } 21 }
22 complete_methods(acc, ctx, receiver_ty)?; 22 complete_methods(acc, ctx, receiver_ty);
23 Ok(()) 23 Ok(())
24} 24}
25 25
@@ -55,11 +55,7 @@ fn complete_fields(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty)
55 } 55 }
56} 56}
57 57
58fn complete_methods( 58fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: Ty) {
59 acc: &mut Completions,
60 ctx: &CompletionContext,
61 receiver: Ty,
62) -> Cancelable<()> {
63 receiver.iterate_methods(ctx.db, |func| { 59 receiver.iterate_methods(ctx.db, |func| {
64 let sig = func.signature(ctx.db); 60 let sig = func.signature(ctx.db);
65 if sig.has_self_param() { 61 if sig.has_self_param() {
@@ -68,9 +64,8 @@ fn complete_methods(
68 .kind(CompletionItemKind::Method) 64 .kind(CompletionItemKind::Method)
69 .add_to(acc); 65 .add_to(acc);
70 } 66 }
71 Ok(None::<()>) 67 None::<()>
72 })?; 68 });
73 Ok(())
74} 69}
75 70
76#[cfg(test)] 71#[cfg(test)]