diff options
Diffstat (limited to 'crates/ra_hir/src/code_model/src.rs')
-rw-r--r-- | crates/ra_hir/src/code_model/src.rs | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index 72451e0e7..32bd9c661 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use ra_syntax::{ast, TreeArc}; | 1 | use ra_syntax::ast; |
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | ids::AstItemDef, AstDatabase, Const, DefDatabase, Enum, EnumVariant, FieldSource, Function, | 4 | ids::AstItemDef, AstDatabase, Const, DefDatabase, Enum, EnumVariant, FieldSource, Function, |
@@ -34,7 +34,7 @@ impl Module { | |||
34 | pub fn declaration_source( | 34 | pub fn declaration_source( |
35 | self, | 35 | self, |
36 | db: &(impl DefDatabase + AstDatabase), | 36 | db: &(impl DefDatabase + AstDatabase), |
37 | ) -> Option<Source<TreeArc<ast::Module>>> { | 37 | ) -> Option<Source<ast::Module>> { |
38 | let def_map = db.crate_def_map(self.krate); | 38 | let def_map = db.crate_def_map(self.krate); |
39 | let decl = def_map[self.module_id].declaration?; | 39 | let decl = def_map[self.module_id].declaration?; |
40 | let ast = decl.to_node(db); | 40 | let ast = decl.to_node(db); |
@@ -49,62 +49,62 @@ impl HasSource for StructField { | |||
49 | } | 49 | } |
50 | } | 50 | } |
51 | impl HasSource for Struct { | 51 | impl HasSource for Struct { |
52 | type Ast = TreeArc<ast::StructDef>; | 52 | type Ast = ast::StructDef; |
53 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::StructDef>> { | 53 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::StructDef> { |
54 | self.id.source(db) | 54 | self.id.source(db) |
55 | } | 55 | } |
56 | } | 56 | } |
57 | impl HasSource for Union { | 57 | impl HasSource for Union { |
58 | type Ast = TreeArc<ast::StructDef>; | 58 | type Ast = ast::StructDef; |
59 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::StructDef>> { | 59 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::StructDef> { |
60 | self.id.source(db) | 60 | self.id.source(db) |
61 | } | 61 | } |
62 | } | 62 | } |
63 | impl HasSource for Enum { | 63 | impl HasSource for Enum { |
64 | type Ast = TreeArc<ast::EnumDef>; | 64 | type Ast = ast::EnumDef; |
65 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::EnumDef>> { | 65 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::EnumDef> { |
66 | self.id.source(db) | 66 | self.id.source(db) |
67 | } | 67 | } |
68 | } | 68 | } |
69 | impl HasSource for EnumVariant { | 69 | impl HasSource for EnumVariant { |
70 | type Ast = TreeArc<ast::EnumVariant>; | 70 | type Ast = ast::EnumVariant; |
71 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::EnumVariant>> { | 71 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::EnumVariant> { |
72 | self.source_impl(db) | 72 | self.source_impl(db) |
73 | } | 73 | } |
74 | } | 74 | } |
75 | impl HasSource for Function { | 75 | impl HasSource for Function { |
76 | type Ast = TreeArc<ast::FnDef>; | 76 | type Ast = ast::FnDef; |
77 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::FnDef>> { | 77 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::FnDef> { |
78 | self.id.source(db) | 78 | self.id.source(db) |
79 | } | 79 | } |
80 | } | 80 | } |
81 | impl HasSource for Const { | 81 | impl HasSource for Const { |
82 | type Ast = TreeArc<ast::ConstDef>; | 82 | type Ast = ast::ConstDef; |
83 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::ConstDef>> { | 83 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::ConstDef> { |
84 | self.id.source(db) | 84 | self.id.source(db) |
85 | } | 85 | } |
86 | } | 86 | } |
87 | impl HasSource for Static { | 87 | impl HasSource for Static { |
88 | type Ast = TreeArc<ast::StaticDef>; | 88 | type Ast = ast::StaticDef; |
89 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::StaticDef>> { | 89 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::StaticDef> { |
90 | self.id.source(db) | 90 | self.id.source(db) |
91 | } | 91 | } |
92 | } | 92 | } |
93 | impl HasSource for Trait { | 93 | impl HasSource for Trait { |
94 | type Ast = TreeArc<ast::TraitDef>; | 94 | type Ast = ast::TraitDef; |
95 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::TraitDef>> { | 95 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::TraitDef> { |
96 | self.id.source(db) | 96 | self.id.source(db) |
97 | } | 97 | } |
98 | } | 98 | } |
99 | impl HasSource for TypeAlias { | 99 | impl HasSource for TypeAlias { |
100 | type Ast = TreeArc<ast::TypeAliasDef>; | 100 | type Ast = ast::TypeAliasDef; |
101 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::TypeAliasDef>> { | 101 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::TypeAliasDef> { |
102 | self.id.source(db) | 102 | self.id.source(db) |
103 | } | 103 | } |
104 | } | 104 | } |
105 | impl HasSource for MacroDef { | 105 | impl HasSource for MacroDef { |
106 | type Ast = TreeArc<ast::MacroCall>; | 106 | type Ast = ast::MacroCall; |
107 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<TreeArc<ast::MacroCall>> { | 107 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::MacroCall> { |
108 | Source { file_id: self.id.0.file_id(), ast: self.id.0.to_node(db) } | 108 | Source { file_id: self.id.0.file_id(), ast: self.id.0.to_node(db) } |
109 | } | 109 | } |
110 | } | 110 | } |