mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Rename Type => TypeAlias
This commit is contained in:
parent
61d9612633
commit
bd8ed644e4
12 changed files with 57 additions and 43 deletions
|
@ -85,9 +85,19 @@ pub enum ModuleDef {
|
|||
Const(Const),
|
||||
Static(Static),
|
||||
Trait(Trait),
|
||||
Type(Type),
|
||||
TypeAlias(TypeAlias),
|
||||
}
|
||||
impl_froms!(ModuleDef: Module, Function, Struct, Enum, EnumVariant, Const, Static, Trait, Type);
|
||||
impl_froms!(
|
||||
ModuleDef: Module,
|
||||
Function,
|
||||
Struct,
|
||||
Enum,
|
||||
EnumVariant,
|
||||
Const,
|
||||
Static,
|
||||
Trait,
|
||||
TypeAlias
|
||||
);
|
||||
|
||||
pub enum ModuleSource {
|
||||
SourceFile(TreeArc<ast::SourceFile>),
|
||||
|
@ -604,11 +614,11 @@ impl Docs for Trait {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct Type {
|
||||
pub struct TypeAlias {
|
||||
pub(crate) id: TypeId,
|
||||
}
|
||||
|
||||
impl Type {
|
||||
impl TypeAlias {
|
||||
pub fn source(&self, db: &impl PersistentHirDatabase) -> (HirFileId, TreeArc<ast::TypeDef>) {
|
||||
self.id.source(db)
|
||||
}
|
||||
|
@ -645,7 +655,7 @@ impl Type {
|
|||
}
|
||||
}
|
||||
|
||||
impl Docs for Type {
|
||||
impl Docs for TypeAlias {
|
||||
fn docs(&self, db: &impl HirDatabase) -> Option<Documentation> {
|
||||
docs_from_ast(&*self.source(db).1)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue