aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/source_binder.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index f0ed8e2b2..6d75296a5 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -140,6 +140,11 @@ impl Expansion {
140 exp_info.map_token_down(token) 140 exp_info.map_token_down(token)
141 } 141 }
142 142
143 pub fn source(&self, db: &impl HirDatabase) -> Source<AstId<ast::MacroCall>> {
144 let loc = db.lookup_intern_macro(self.macro_call_id);
145 Source::new(self.file_id(), loc.ast_id)
146 }
147
143 fn file_id(&self) -> HirFileId { 148 fn file_id(&self) -> HirFileId {
144 self.macro_call_id.as_file(MacroFileKind::Items) 149 self.macro_call_id.as_file(MacroFileKind::Items)
145 } 150 }