aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/presentation.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-05-30 14:13:06 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-05-30 14:13:06 +0100
commit3cf841e1bc2bf354c180dc80fb394c0e0a843965 (patch)
treef01cf9c3589ae920c50696ce244c98b2454834b3 /crates/ra_ide_api/src/completion/presentation.rs
parent6b88735fe6cd3b259816c7c90a2675ee057c9e4c (diff)
parentb6a854e161cc122e6d9ae12084b6a1d1f4d0f241 (diff)
Merge #1352
1352: Builtins r=matklad a=matklad closes #1340 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion/presentation.rs')
-rw-r--r--crates/ra_ide_api/src/completion/presentation.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs
index 064d379a4..d405161d6 100644
--- a/crates/ra_ide_api/src/completion/presentation.rs
+++ b/crates/ra_ide_api/src/completion/presentation.rs
@@ -57,6 +57,7 @@ impl Completions {
57 } 57 }
58 Some(it) => it, 58 Some(it) => it,
59 }; 59 };
60 let mut completion_kind = CompletionKind::Reference;
60 let (kind, docs) = match def { 61 let (kind, docs) = match def {
61 Resolution::Def(Module(it)) => (CompletionItemKind::Module, it.docs(ctx.db)), 62 Resolution::Def(Module(it)) => (CompletionItemKind::Module, it.docs(ctx.db)),
62 Resolution::Def(Function(func)) => { 63 Resolution::Def(Function(func)) => {
@@ -70,6 +71,10 @@ impl Completions {
70 Resolution::Def(Static(it)) => (CompletionItemKind::Static, it.docs(ctx.db)), 71 Resolution::Def(Static(it)) => (CompletionItemKind::Static, it.docs(ctx.db)),
71 Resolution::Def(Trait(it)) => (CompletionItemKind::Trait, it.docs(ctx.db)), 72 Resolution::Def(Trait(it)) => (CompletionItemKind::Trait, it.docs(ctx.db)),
72 Resolution::Def(TypeAlias(it)) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)), 73 Resolution::Def(TypeAlias(it)) => (CompletionItemKind::TypeAlias, it.docs(ctx.db)),
74 Resolution::Def(BuiltinType(..)) => {
75 completion_kind = CompletionKind::BuiltinType;
76 (CompletionItemKind::BuiltinType, None)
77 }
73 Resolution::GenericParam(..) => (CompletionItemKind::TypeParam, None), 78 Resolution::GenericParam(..) => (CompletionItemKind::TypeParam, None),
74 Resolution::LocalBinding(..) => (CompletionItemKind::Binding, None), 79 Resolution::LocalBinding(..) => (CompletionItemKind::Binding, None),
75 Resolution::SelfType(..) => ( 80 Resolution::SelfType(..) => (
@@ -77,7 +82,7 @@ impl Completions {
77 None, 82 None,
78 ), 83 ),
79 }; 84 };
80 CompletionItem::new(CompletionKind::Reference, ctx.source_range(), local_name) 85 CompletionItem::new(completion_kind, ctx.source_range(), local_name)
81 .kind(kind) 86 .kind(kind)
82 .set_documentation(docs) 87 .set_documentation(docs)
83 .add_to(self) 88 .add_to(self)