diff options
author | Aleksey Kladov <[email protected]> | 2019-06-11 00:34:34 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-06-11 16:28:51 +0100 |
commit | 91c120ccea4f0cfef20fd4d918154c8152f83816 (patch) | |
tree | f175e9308486f8594618236d63737042f546b37a /crates/ra_ide_api/src/hover.rs | |
parent | e505fe9d7b96f3454711e923c70d763c5cee5f47 (diff) |
introduce Source struct
Diffstat (limited to 'crates/ra_ide_api/src/hover.rs')
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index fbabeb194..80445761c 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -136,8 +136,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
136 | res.extend(hover_text(it.doc_comment_text(), it.short_label())) | 136 | res.extend(hover_text(it.doc_comment_text(), it.short_label())) |
137 | } | 137 | } |
138 | hir::ModuleDef::Struct(it) => { | 138 | hir::ModuleDef::Struct(it) => { |
139 | let it = it.source(db).1; | 139 | let src = it.source(db); |
140 | res.extend(hover_text(it.doc_comment_text(), it.short_label())) | 140 | res.extend(hover_text(src.ast.doc_comment_text(), src.ast.short_label())) |
141 | } | 141 | } |
142 | hir::ModuleDef::Union(it) => { | 142 | hir::ModuleDef::Union(it) => { |
143 | let it = it.source(db).1; | 143 | let it = it.source(db).1; |
@@ -176,8 +176,11 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
176 | if let Some((adt_def, _)) = ty.as_adt() { | 176 | if let Some((adt_def, _)) = ty.as_adt() { |
177 | match adt_def { | 177 | match adt_def { |
178 | hir::AdtDef::Struct(it) => { | 178 | hir::AdtDef::Struct(it) => { |
179 | let it = it.source(db).1; | 179 | let src = it.source(db); |
180 | res.extend(hover_text(it.doc_comment_text(), it.short_label())) | 180 | res.extend(hover_text( |
181 | src.ast.doc_comment_text(), | ||
182 | src.ast.short_label(), | ||
183 | )) | ||
181 | } | 184 | } |
182 | hir::AdtDef::Union(it) => { | 185 | hir::AdtDef::Union(it) => { |
183 | let it = it.source(db).1; | 186 | let it = it.source(db).1; |