aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-25 09:51:17 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-25 09:51:17 +0000
commitae97cd59ff086e7efb6409f14c2f8ae8861596e4 (patch)
treeb9dcccf99c868b6b2abf75e08fc56f42869b9ce5 /crates/ra_ide_api
parentc4a351b736632f0c01d9c51ce1cd3b4b4c6194d9 (diff)
parent87288d802c3cad7ec50c508276b89a8c454f336c (diff)
Merge #637
637: pack enum variants into arena r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs10
-rw-r--r--crates/ra_ide_api/src/db.rs1
2 files changed, 5 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 e72586e2e..e3f1d42f8 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -27,18 +27,18 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
27 } 27 }
28 } 28 }
29 hir::ModuleDef::Enum(e) => { 29 hir::ModuleDef::Enum(e) => {
30 e.variants(ctx.db) 30 e.variants(ctx.db).into_iter().for_each(|variant| {
31 .into_iter() 31 if let Some(name) = variant.name(ctx.db) {
32 .for_each(|(variant_name, variant)| {
33 CompletionItem::new( 32 CompletionItem::new(
34 CompletionKind::Reference, 33 CompletionKind::Reference,
35 ctx.source_range(), 34 ctx.source_range(),
36 variant_name.to_string(), 35 name.to_string(),
37 ) 36 )
38 .kind(CompletionItemKind::EnumVariant) 37 .kind(CompletionItemKind::EnumVariant)
39 .set_documentation(variant.docs(ctx.db)) 38 .set_documentation(variant.docs(ctx.db))
40 .add_to(acc) 39 .add_to(acc)
41 }); 40 }
41 });
42 } 42 }
43 _ => return, 43 _ => return,
44 }; 44 };
diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs
index bff6b7237..11305613c 100644
--- a/crates/ra_ide_api/src/db.rs
+++ b/crates/ra_ide_api/src/db.rs
@@ -104,7 +104,6 @@ salsa::database_storage! {
104 fn type_for_field() for hir::db::TypeForFieldQuery; 104 fn type_for_field() for hir::db::TypeForFieldQuery;
105 fn struct_data() for hir::db::StructDataQuery; 105 fn struct_data() for hir::db::StructDataQuery;
106 fn enum_data() for hir::db::EnumDataQuery; 106 fn enum_data() for hir::db::EnumDataQuery;
107 fn enum_variant_data() for hir::db::EnumVariantDataQuery;
108 fn impls_in_module() for hir::db::ImplsInModuleQuery; 107 fn impls_in_module() for hir::db::ImplsInModuleQuery;
109 fn impls_in_crate() for hir::db::ImplsInCrateQuery; 108 fn impls_in_crate() for hir::db::ImplsInCrateQuery;
110 fn body_hir() for hir::db::BodyHirQuery; 109 fn body_hir() for hir::db::BodyHirQuery;