aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_scope.rs')
-rw-r--r--crates/ra_ide_api/src/completion/complete_scope.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_scope.rs b/crates/ra_ide_api/src/completion/complete_scope.rs
index 660c7d16e..699680748 100644
--- a/crates/ra_ide_api/src/completion/complete_scope.rs
+++ b/crates/ra_ide_api/src/completion/complete_scope.rs
@@ -1,18 +1,15 @@
1use rustc_hash::FxHashSet; 1use rustc_hash::FxHashSet;
2use ra_syntax::TextUnit; 2use ra_syntax::TextUnit;
3 3
4use crate::{ 4use crate::completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext};
5 Cancelable,
6 completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext},
7};
8 5
9pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) -> Cancelable<()> { 6pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) {
10 if !ctx.is_trivial_path { 7 if !ctx.is_trivial_path {
11 return Ok(()); 8 return;
12 } 9 }
13 let module = match &ctx.module { 10 let module = match &ctx.module {
14 Some(it) => it, 11 Some(it) => it,
15 None => return Ok(()), 12 None => return,
16 }; 13 };
17 if let Some(function) = &ctx.function { 14 if let Some(function) = &ctx.function {
18 let scopes = function.scopes(ctx.db); 15 let scopes = function.scopes(ctx.db);
@@ -40,7 +37,6 @@ pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) ->
40 .from_resolution(ctx, res) 37 .from_resolution(ctx, res)
41 .add_to(acc) 38 .add_to(acc)
42 }); 39 });
43 Ok(())
44} 40}
45 41
46fn complete_fn(acc: &mut Completions, scopes: &hir::ScopesWithSyntaxMapping, offset: TextUnit) { 42fn complete_fn(acc: &mut Completions, scopes: &hir::ScopesWithSyntaxMapping, offset: TextUnit) {