aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-11-17 19:35:46 +0000
committerEdwin Cheng <[email protected]>2019-11-19 13:49:06 +0000
commitae49a22b5cdd47add478fef6bb8ad3d75338e313 (patch)
tree2ac2304eb3cafca527b8a6d817bd37186b3fe89a /crates/ra_hir/src
parent3ccd05fedc46796f793295901a8619492256468e (diff)
Rebase
Diffstat (limited to 'crates/ra_hir/src')
-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 }