diff options
author | Aleksey Kladov <[email protected]> | 2019-01-24 22:31:32 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-24 22:31:32 +0000 |
commit | 0f2f3a21e7e624f920d182869896347af309e909 (patch) | |
tree | 8c16d0a479021c2d558a865df94eb01316a208b2 /crates/ra_ide_api/src/completion | |
parent | 00ba70a0957b8af2813940787238a733298dfa5f (diff) |
Migrate trait & type to new ids
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 7 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/completion_item.rs | 8 |
2 files changed, 4 insertions, 11 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index bd5484516..e72586e2e 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -40,12 +40,7 @@ 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(_) | 43 | _ => return, |
44 | | hir::ModuleDef::Struct(_) | ||
45 | | hir::ModuleDef::Def(_) | ||
46 | | hir::ModuleDef::Const(_) | ||
47 | | hir::ModuleDef::Static(_) | ||
48 | | hir::ModuleDef::EnumVariant(_) => return, | ||
49 | }; | 44 | }; |
50 | } | 45 | } |
51 | 46 | ||
diff --git a/crates/ra_ide_api/src/completion/completion_item.rs b/crates/ra_ide_api/src/completion/completion_item.rs index 2f8ec41d2..4e679281c 100644 --- a/crates/ra_ide_api/src/completion/completion_item.rs +++ b/crates/ra_ide_api/src/completion/completion_item.rs | |||
@@ -225,11 +225,9 @@ impl Builder { | |||
225 | hir::ModuleDef::EnumVariant(it) => (CompletionItemKind::EnumVariant, it.docs(ctx.db)), | 225 | hir::ModuleDef::EnumVariant(it) => (CompletionItemKind::EnumVariant, it.docs(ctx.db)), |
226 | hir::ModuleDef::Const(it) => (CompletionItemKind::Const, it.docs(ctx.db)), | 226 | hir::ModuleDef::Const(it) => (CompletionItemKind::Const, it.docs(ctx.db)), |
227 | hir::ModuleDef::Static(it) => (CompletionItemKind::Static, it.docs(ctx.db)), | 227 | hir::ModuleDef::Static(it) => (CompletionItemKind::Static, it.docs(ctx.db)), |
228 | hir::ModuleDef::Def(def_id) => match def_id.resolve(ctx.db) { | 228 | hir::ModuleDef::Trait(it) => (CompletionItemKind::Trait, it.docs(ctx.db)), |
229 | hir::Def::Trait(it) => (CompletionItemKind::Trait, it.docs(ctx.db)), | 229 | hir::ModuleDef::Type(it) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)), |
230 | hir::Def::Type(it) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)), | 230 | hir::ModuleDef::Def(_) => return self, |
231 | _ => return self, | ||
232 | }, | ||
233 | }; | 231 | }; |
234 | self.kind = Some(kind); | 232 | self.kind = Some(kind); |
235 | self.documentation = docs; | 233 | self.documentation = docs; |