aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_path.rs')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs
index 42468681a..1eded7658 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -1,16 +1,15 @@
1use crate::{ 1use crate::{
2 Cancelable,
3 completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext}, 2 completion::{CompletionItem, CompletionItemKind, Completions, CompletionKind, CompletionContext},
4}; 3};
5 4
6pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> Cancelable<()> { 5pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
7 let (path, module) = match (&ctx.path_prefix, &ctx.module) { 6 let (path, module) = match (&ctx.path_prefix, &ctx.module) {
8 (Some(path), Some(module)) => (path.clone(), module), 7 (Some(path), Some(module)) => (path.clone(), module),
9 _ => return Ok(()), 8 _ => return,
10 }; 9 };
11 let def_id = match module.resolve_path(ctx.db, &path).take_types() { 10 let def_id = match module.resolve_path(ctx.db, &path).take_types() {
12 Some(it) => it, 11 Some(it) => it,
13 None => return Ok(()), 12 None => return,
14 }; 13 };
15 match def_id.resolve(ctx.db) { 14 match def_id.resolve(ctx.db) {
16 hir::Def::Module(module) => { 15 hir::Def::Module(module) => {
@@ -30,9 +29,8 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> C
30 .add_to(acc) 29 .add_to(acc)
31 }); 30 });
32 } 31 }
33 _ => return Ok(()), 32 _ => return,
34 }; 33 };
35 Ok(())
36} 34}
37 35
38#[cfg(test)] 36#[cfg(test)]