aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/hover.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-06-11 15:25:55 +0100
committerAleksey Kladov <[email protected]>2019-06-11 16:28:51 +0100
commitf2ccc54468348af96d6167da5971749ef0f4ab5e (patch)
tree87de4b002bcdca775ff339b81236dea1eb4ed8c9 /crates/ra_ide_api/src/hover.rs
parent647c8f3df8e5f798f940ce0b93e5e0ccd59b0e7f (diff)
use Source for TypeAlias
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r--crates/ra_ide_api/src/hover.rs18
1 files changed, 6 insertions, 12 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 0f68cacca..c4826e515 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -107,14 +107,11 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
107 res.extend(hover_text(it.doc_comment_text(), it.short_label())); 107 res.extend(hover_text(it.doc_comment_text(), it.short_label()));
108 } 108 }
109 } 109 }
110 Some(AssocItem(it)) => match it { 110 Some(AssocItem(it)) => res.extend(match it {
111 hir::ImplItem::Method(it) => res.extend(from_def_source(db, it)), 111 hir::ImplItem::Method(it) => from_def_source(db, it),
112 hir::ImplItem::Const(it) => res.extend(from_def_source(db, it)), 112 hir::ImplItem::Const(it) => from_def_source(db, it),
113 hir::ImplItem::TypeAlias(it) => { 113 hir::ImplItem::TypeAlias(it) => from_def_source(db, it),
114 let it = it.source(db).1; 114 }),
115 res.extend(hover_text(it.doc_comment_text(), it.short_label()))
116 }
117 },
118 Some(Def(it)) => { 115 Some(Def(it)) => {
119 match it { 116 match it {
120 hir::ModuleDef::Module(it) => { 117 hir::ModuleDef::Module(it) => {
@@ -137,10 +134,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
137 let it = it.source(db).1; 134 let it = it.source(db).1;
138 res.extend(hover_text(it.doc_comment_text(), it.short_label())) 135 res.extend(hover_text(it.doc_comment_text(), it.short_label()))
139 } 136 }
140 hir::ModuleDef::TypeAlias(it) => { 137 hir::ModuleDef::TypeAlias(it) => res.extend(from_def_source(db, it)),
141 let it = it.source(db).1;
142 res.extend(hover_text(it.doc_comment_text(), it.short_label()))
143 }
144 hir::ModuleDef::BuiltinType(_) => { 138 hir::ModuleDef::BuiltinType(_) => {
145 // FIXME: hover for builtin Type ? 139 // FIXME: hover for builtin Type ?
146 } 140 }