aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model/src.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs
index c4e62f799..6d116ee75 100644
--- a/crates/ra_hir/src/code_model/src.rs
+++ b/crates/ra_hir/src/code_model/src.rs
@@ -6,8 +6,8 @@ use crate::{
6 adt::VariantDef, 6 adt::VariantDef,
7 db::{AstDatabase, DefDatabase, HirDatabase}, 7 db::{AstDatabase, DefDatabase, HirDatabase},
8 ids::AstItemDef, 8 ids::AstItemDef,
9 Const, Either, Enum, EnumVariant, FieldSource, Function, HasBody, HirFileId, MacroDef, 9 Const, Either, Enum, EnumVariant, FieldSource, Function, HasBody, HirFileId, MacroDef, Module,
10 MacroDefId, Module, ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union, 10 ModuleSource, Static, Struct, StructField, Trait, TypeAlias, Union,
11}; 11};
12 12
13pub use hir_expand::Source; 13pub use hir_expand::Source;
@@ -140,15 +140,10 @@ impl HasSource for TypeAlias {
140 self.id.source(db) 140 self.id.source(db)
141 } 141 }
142} 142}
143
144impl HasSource for MacroDef { 143impl HasSource for MacroDef {
145 type Ast = ast::MacroCall; 144 type Ast = ast::MacroCall;
146 fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::MacroCall> { 145 fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<ast::MacroCall> {
147 let ast_id = match self.id { 146 Source { file_id: self.id.ast_id.file_id(), ast: self.id.ast_id.to_node(db) }
148 MacroDefId::DeclarativeMacro(it) => it.ast_id,
149 MacroDefId::BuiltinMacro(it) => it.ast_id,
150 };
151 Source { file_id: ast_id.file_id(), ast: ast_id.to_node(db) }
152 } 147 }
153} 148}
154 149