diff options
author | Aleksey Kladov <[email protected]> | 2019-01-24 20:36:16 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-24 20:36:16 +0000 |
commit | 6a5a1f590201ba962a1f77ce1a7ff5870712728d (patch) | |
tree | fc7bbab600b4bbf025476b39885ebee61a0d1710 /crates/ra_ide_api/src/completion | |
parent | 4c514a3e02b019cdd3a17c9bcd78d93c210ab267 (diff) |
adapt ide_api to the new API
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 5 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_item.rs | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index e039a333c..4768efdc1 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -40,7 +40,10 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { | |||
40 | .add_to(acc) | 40 | .add_to(acc) |
41 | }); | 41 | }); |
42 | } | 42 | } |
43 | hir::ModuleDef::Function(_) | hir::ModuleDef::Struct(_) | hir::ModuleDef::Def(_) => return, | 43 | hir::ModuleDef::Function(_) |
44 | | hir::ModuleDef::Struct(_) | ||
45 | | hir::ModuleDef::Def(_) | ||
46 | | hir::ModuleDef::EnumVariant(_) => return, | ||
44 | }; | 47 | }; |
45 | } | 48 | } |
46 | 49 | ||
diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs index f2301653a..ee1f8bce0 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide_api/src/completion/completion_item.rs | |||
@@ -222,6 +222,7 @@ impl Builder { | |||
222 | hir::ModuleDef::Function(func) => return self.from_function(ctx, func), | 222 | hir::ModuleDef::Function(func) => return self.from_function(ctx, func), |
223 | hir::ModuleDef::Struct(it) => (CompletionItemKind::Struct, it.docs(ctx.db)), | 223 | hir::ModuleDef::Struct(it) => (CompletionItemKind::Struct, it.docs(ctx.db)), |
224 | hir::ModuleDef::Enum(it) => (CompletionItemKind::Enum, it.docs(ctx.db)), | 224 | hir::ModuleDef::Enum(it) => (CompletionItemKind::Enum, it.docs(ctx.db)), |
225 | hir::ModuleDef::EnumVariant(it) => (CompletionItemKind::EnumVariant, it.docs(ctx.db)), | ||
225 | hir::ModuleDef::Def(def_id) => match def_id.resolve(ctx.db) { | 226 | hir::ModuleDef::Def(def_id) => match def_id.resolve(ctx.db) { |
226 | hir::Def::Trait(it) => (CompletionItemKind::Trait, it.docs(ctx.db)), | 227 | hir::Def::Trait(it) => (CompletionItemKind::Trait, it.docs(ctx.db)), |
227 | hir::Def::Type(it) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)), | 228 | hir::Def::Type(it) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)), |