diff options
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 6 | ||||
-rw-r--r-- | crates/ra_ide_api/src/hover.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index e5e1aa011..efba122b1 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -168,9 +168,9 @@ impl NavigationTarget { | |||
168 | } | 168 | } |
169 | 169 | ||
170 | pub(crate) fn from_field(db: &RootDatabase, field: hir::StructField) -> NavigationTarget { | 170 | pub(crate) fn from_field(db: &RootDatabase, field: hir::StructField) -> NavigationTarget { |
171 | let (file_id, field) = field.source(db); | 171 | let src = field.source(db); |
172 | let file_id = file_id.original_file(db); | 172 | let file_id = src.file_id.original_file(db); |
173 | match field { | 173 | match src.ast { |
174 | FieldSource::Named(it) => { | 174 | FieldSource::Named(it) => { |
175 | NavigationTarget::from_named(file_id, &*it, it.doc_comment_text(), it.short_label()) | 175 | NavigationTarget::from_named(file_id, &*it, it.doc_comment_text(), it.short_label()) |
176 | } | 176 | } |
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 72328a72b..e43c1d8e5 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs | |||
@@ -102,8 +102,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn | |||
102 | res.extend(hover_text(src.ast.doc_comment_text(), None)); | 102 | res.extend(hover_text(src.ast.doc_comment_text(), None)); |
103 | } | 103 | } |
104 | Some(FieldAccess(it)) => { | 104 | Some(FieldAccess(it)) => { |
105 | let it = it.source(db).1; | 105 | let src = it.source(db); |
106 | if let hir::FieldSource::Named(it) = it { | 106 | if let hir::FieldSource::Named(it) = src.ast { |
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 | } |