use Source for StructField

This commit is contained in:
Aleksey Kladov 2019-06-11 17:43:36 +03:00
parent 8b94b429e5
commit 178d8e96b5
5 changed files with 17 additions and 10 deletions

View file

@ -168,9 +168,9 @@ impl NavigationTarget {
}
pub(crate) fn from_field(db: &RootDatabase, field: hir::StructField) -> NavigationTarget {
let (file_id, field) = field.source(db);
let file_id = file_id.original_file(db);
match field {
let src = field.source(db);
let file_id = src.file_id.original_file(db);
match src.ast {
FieldSource::Named(it) => {
NavigationTarget::from_named(file_id, &*it, it.doc_comment_text(), it.short_label())
}