diff options
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 20 | ||||
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 10 |
2 files changed, 4 insertions, 26 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index 19a64f300..2e3e3863a 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -214,24 +214,8 @@ impl NavigationTarget { | |||
214 | hir::ModuleDef::Union(it) => NavigationTarget::from_adt_def(db, it.into()), | 214 | hir::ModuleDef::Union(it) => NavigationTarget::from_adt_def(db, it.into()), |
215 | hir::ModuleDef::Const(it) => NavigationTarget::from_def_source(db, it), | 215 | hir::ModuleDef::Const(it) => NavigationTarget::from_def_source(db, it), |
216 | hir::ModuleDef::Static(it) => NavigationTarget::from_def_source(db, it), | 216 | hir::ModuleDef::Static(it) => NavigationTarget::from_def_source(db, it), |
217 | hir::ModuleDef::EnumVariant(var) => { | 217 | hir::ModuleDef::EnumVariant(it) => NavigationTarget::from_def_source(db, it), |
218 | let src = var.source(db); | 218 | hir::ModuleDef::Trait(it) => NavigationTarget::from_def_source(db, it), |
219 | NavigationTarget::from_named( | ||
220 | src.file_id.original_file(db), | ||
221 | &*src.ast, | ||
222 | src.ast.doc_comment_text(), | ||
223 | src.ast.short_label(), | ||
224 | ) | ||
225 | } | ||
226 | hir::ModuleDef::Trait(e) => { | ||
227 | let (file_id, node) = e.source(db); | ||
228 | NavigationTarget::from_named( | ||
229 | file_id.original_file(db), | ||
230 | &*node, | ||
231 | node.doc_comment_text(), | ||
232 | node.short_label(), | ||
233 | ) | ||
234 | } | ||
235 | hir::ModuleDef::TypeAlias(it) => NavigationTarget::from_def_source(db, it), | 219 | hir::ModuleDef::TypeAlias(it) => NavigationTarget::from_def_source(db, it), |
236 | hir::ModuleDef::BuiltinType(..) => { | 220 | hir::ModuleDef::BuiltinType(..) => { |
237 | return None; | 221 | return None; |
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 237e1f4a1..c4004435c 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -124,16 +124,10 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
124 | hir::ModuleDef::Struct(it) => res.extend(from_def_source(db, it)), | 124 | hir::ModuleDef::Struct(it) => res.extend(from_def_source(db, it)), |
125 | hir::ModuleDef::Union(it) => res.extend(from_def_source(db, it)), | 125 | hir::ModuleDef::Union(it) => res.extend(from_def_source(db, it)), |
126 | hir::ModuleDef::Enum(it) => res.extend(from_def_source(db, it)), | 126 | hir::ModuleDef::Enum(it) => res.extend(from_def_source(db, it)), |
127 | hir::ModuleDef::EnumVariant(it) => { | 127 | hir::ModuleDef::EnumVariant(it) => res.extend(from_def_source(db, it)), |
128 | let src = it.source(db); | ||
129 | res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label())) | ||
130 | } | ||
131 | hir::ModuleDef::Const(it) => res.extend(from_def_source(db, it)), | 128 | hir::ModuleDef::Const(it) => res.extend(from_def_source(db, it)), |
132 | hir::ModuleDef::Static(it) => res.extend(from_def_source(db, it)), | 129 | hir::ModuleDef::Static(it) => res.extend(from_def_source(db, it)), |
133 | hir::ModuleDef::Trait(it) => { | 130 | hir::ModuleDef::Trait(it) => res.extend(from_def_source(db, it)), |
134 | let it = it.source(db).1; | ||
135 | res.extend(hover_text(it.doc_comment_text(), it.short_label())) | ||
136 | } | ||
137 | hir::ModuleDef::TypeAlias(it) => res.extend(from_def_source(db, it)), | 131 | hir::ModuleDef::TypeAlias(it) => res.extend(from_def_source(db, it)), |
138 | hir::ModuleDef::BuiltinType(_) => { | 132 | hir::ModuleDef::BuiltinType(_) => { |
139 | // FIXME: hover for builtin Type ? | 133 | // FIXME: hover for builtin Type ? |