diff options
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 3fce73e8a..92f3902dd 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs | |||
@@ -157,6 +157,13 @@ impl HirFileId { | |||
157 | } | 157 | } |
158 | } | 158 | } |
159 | } | 159 | } |
160 | |||
161 | pub fn macro_file(self) -> Option<MacroFile> { | ||
162 | match self.0 { | ||
163 | HirFileIdRepr::FileId(_) => None, | ||
164 | HirFileIdRepr::MacroFile(m) => Some(m), | ||
165 | } | ||
166 | } | ||
160 | } | 167 | } |
161 | 168 | ||
162 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 169 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -296,7 +303,7 @@ pub struct ExpansionInfo { | |||
296 | exp_map: Arc<mbe::TokenMap>, | 303 | exp_map: Arc<mbe::TokenMap>, |
297 | } | 304 | } |
298 | 305 | ||
299 | pub use mbe::Origin; | 306 | pub use mbe::{syntax_node_to_token_tree, Origin}; |
300 | use ra_parser::FragmentKind; | 307 | use ra_parser::FragmentKind; |
301 | 308 | ||
302 | impl ExpansionInfo { | 309 | impl ExpansionInfo { |