aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs5
-rw-r--r--crates/ra_ide_api/src/completion/completion_item.rs1
-rw-r--r--crates/ra_ide_api/src/navigation_target.rs11
3 files changed, 12 insertions, 5 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)),
diff --git a/crates/ra_ide_api/src/navigation_target.rs b/crates/ra_ide_api/src/navigation_target.rs
index b92670f36..fc76338d2 100644
--- a/crates/ra_ide_api/src/navigation_target.rs
+++ b/crates/ra_ide_api/src/navigation_target.rs
@@ -128,13 +128,16 @@ impl NavigationTarget {
128 &*node, 128 &*node,
129 )); 129 ));
130 } 130 }
131 hir::ModuleDef::EnumVariant(var) => {
132 let (file_id, node) = var.source(db);
133 return Some(NavigationTarget::from_named(
134 file_id.original_file(db),
135 &*node,
136 ));
137 }
131 }; 138 };
132 139
133 let res = match def { 140 let res = match def {
134 Def::EnumVariant(ev) => {
135 let (file_id, node) = ev.source(db);
136 NavigationTarget::from_named(file_id.original_file(db), &*node)
137 }
138 Def::Trait(f) => { 141 Def::Trait(f) => {
139 let (file_id, node) = f.source(db); 142 let (file_id, node) = f.source(db);
140 NavigationTarget::from_named(file_id.original_file(db), &*node) 143 NavigationTarget::from_named(file_id.original_file(db), &*node)