From 24e98121d81b75bafcd9c6005548776c00de8401 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 7 Mar 2020 15:27:03 +0100 Subject: Try to complete within macros --- crates/ra_hir_expand/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_expand/src/lib.rs') 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 { } } } + + pub fn macro_file(self) -> Option { + match self.0 { + HirFileIdRepr::FileId(_) => None, + HirFileIdRepr::MacroFile(m) => Some(m), + } + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -296,7 +303,7 @@ pub struct ExpansionInfo { exp_map: Arc, } -pub use mbe::Origin; +pub use mbe::{syntax_node_to_token_tree, Origin}; use ra_parser::FragmentKind; impl ExpansionInfo { -- cgit v1.2.3