aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/has_source.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/has_source.rs')
-rw-r--r--crates/ra_hir/src/has_source.rs42
1 files changed, 21 insertions, 21 deletions
diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs
index 4fd675039..db9228d67 100644
--- a/crates/ra_hir/src/has_source.rs
+++ b/crates/ra_hir/src/has_source.rs
@@ -57,56 +57,56 @@ impl HasSource for Field {
57 } 57 }
58} 58}
59impl HasSource for Struct { 59impl HasSource for Struct {
60 type Ast = ast::StructDef; 60 type Ast = ast::Struct;
61 fn source(self, db: &dyn HirDatabase) -> InFile<ast::StructDef> { 61 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Struct> {
62 self.id.lookup(db.upcast()).source(db.upcast()) 62 self.id.lookup(db.upcast()).source(db.upcast())
63 } 63 }
64} 64}
65impl HasSource for Union { 65impl HasSource for Union {
66 type Ast = ast::UnionDef; 66 type Ast = ast::Union;
67 fn source(self, db: &dyn HirDatabase) -> InFile<ast::UnionDef> { 67 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Union> {
68 self.id.lookup(db.upcast()).source(db.upcast()) 68 self.id.lookup(db.upcast()).source(db.upcast())
69 } 69 }
70} 70}
71impl HasSource for Enum { 71impl HasSource for Enum {
72 type Ast = ast::EnumDef; 72 type Ast = ast::Enum;
73 fn source(self, db: &dyn HirDatabase) -> InFile<ast::EnumDef> { 73 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Enum> {
74 self.id.lookup(db.upcast()).source(db.upcast()) 74 self.id.lookup(db.upcast()).source(db.upcast())
75 } 75 }
76} 76}
77impl HasSource for EnumVariant { 77impl HasSource for EnumVariant {
78 type Ast = ast::EnumVariant; 78 type Ast = ast::Variant;
79 fn source(self, db: &dyn HirDatabase) -> InFile<ast::EnumVariant> { 79 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Variant> {
80 self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone()) 80 self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone())
81 } 81 }
82} 82}
83impl HasSource for Function { 83impl HasSource for Function {
84 type Ast = ast::FnDef; 84 type Ast = ast::Fn;
85 fn source(self, db: &dyn HirDatabase) -> InFile<ast::FnDef> { 85 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Fn> {
86 self.id.lookup(db.upcast()).source(db.upcast()) 86 self.id.lookup(db.upcast()).source(db.upcast())
87 } 87 }
88} 88}
89impl HasSource for Const { 89impl HasSource for Const {
90 type Ast = ast::ConstDef; 90 type Ast = ast::Const;
91 fn source(self, db: &dyn HirDatabase) -> InFile<ast::ConstDef> { 91 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Const> {
92 self.id.lookup(db.upcast()).source(db.upcast()) 92 self.id.lookup(db.upcast()).source(db.upcast())
93 } 93 }
94} 94}
95impl HasSource for Static { 95impl HasSource for Static {
96 type Ast = ast::StaticDef; 96 type Ast = ast::Static;
97 fn source(self, db: &dyn HirDatabase) -> InFile<ast::StaticDef> { 97 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Static> {
98 self.id.lookup(db.upcast()).source(db.upcast()) 98 self.id.lookup(db.upcast()).source(db.upcast())
99 } 99 }
100} 100}
101impl HasSource for Trait { 101impl HasSource for Trait {
102 type Ast = ast::TraitDef; 102 type Ast = ast::Trait;
103 fn source(self, db: &dyn HirDatabase) -> InFile<ast::TraitDef> { 103 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Trait> {
104 self.id.lookup(db.upcast()).source(db.upcast()) 104 self.id.lookup(db.upcast()).source(db.upcast())
105 } 105 }
106} 106}
107impl HasSource for TypeAlias { 107impl HasSource for TypeAlias {
108 type Ast = ast::TypeAliasDef; 108 type Ast = ast::TypeAlias;
109 fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAliasDef> { 109 fn source(self, db: &dyn HirDatabase) -> InFile<ast::TypeAlias> {
110 self.id.lookup(db.upcast()).source(db.upcast()) 110 self.id.lookup(db.upcast()).source(db.upcast())
111 } 111 }
112} 112}
@@ -120,14 +120,14 @@ impl HasSource for MacroDef {
120 } 120 }
121} 121}
122impl HasSource for ImplDef { 122impl HasSource for ImplDef {
123 type Ast = ast::ImplDef; 123 type Ast = ast::Impl;
124 fn source(self, db: &dyn HirDatabase) -> InFile<ast::ImplDef> { 124 fn source(self, db: &dyn HirDatabase) -> InFile<ast::Impl> {
125 self.id.lookup(db.upcast()).source(db.upcast()) 125 self.id.lookup(db.upcast()).source(db.upcast())
126 } 126 }
127} 127}
128 128
129impl HasSource for TypeParam { 129impl HasSource for TypeParam {
130 type Ast = Either<ast::TraitDef, ast::TypeParam>; 130 type Ast = Either<ast::Trait, ast::TypeParam>;
131 fn source(self, db: &dyn HirDatabase) -> InFile<Self::Ast> { 131 fn source(self, db: &dyn HirDatabase) -> InFile<Self::Ast> {
132 let child_source = self.id.parent.child_source(db.upcast()); 132 let child_source = self.id.parent.child_source(db.upcast());
133 child_source.map(|it| it[self.id.local_id].clone()) 133 child_source.map(|it| it[self.id.local_id].clone())