mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
use Source for TypeAlias
This commit is contained in:
parent
647c8f3df8
commit
f2ccc54468
7 changed files with 22 additions and 38 deletions
|
@ -232,15 +232,7 @@ impl NavigationTarget {
|
|||
node.short_label(),
|
||||
)
|
||||
}
|
||||
hir::ModuleDef::TypeAlias(e) => {
|
||||
let (file_id, node) = e.source(db);
|
||||
NavigationTarget::from_named(
|
||||
file_id.original_file(db),
|
||||
&*node,
|
||||
node.doc_comment_text(),
|
||||
node.short_label(),
|
||||
)
|
||||
}
|
||||
hir::ModuleDef::TypeAlias(it) => NavigationTarget::from_def_source(db, it),
|
||||
hir::ModuleDef::BuiltinType(..) => {
|
||||
return None;
|
||||
}
|
||||
|
@ -267,15 +259,7 @@ impl NavigationTarget {
|
|||
match impl_item {
|
||||
ImplItem::Method(it) => NavigationTarget::from_function(db, it),
|
||||
ImplItem::Const(it) => NavigationTarget::from_def_source(db, it),
|
||||
ImplItem::TypeAlias(a) => {
|
||||
let (file_id, node) = a.source(db);
|
||||
NavigationTarget::from_named(
|
||||
file_id.original_file(db),
|
||||
&*node,
|
||||
node.doc_comment_text(),
|
||||
node.short_label(),
|
||||
)
|
||||
}
|
||||
ImplItem::TypeAlias(it) => NavigationTarget::from_def_source(db, it),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue