]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_expand/src/lib.rs
Don't search for root nodes unnecessarily
[rust.git] / crates / hir_expand / src / lib.rs
index 4742cb089eb578c833b4bc990db48a5563f5b8ae..97436446729250640024d9b0349daceef4033af0 100644 (file)
@@ -18,7 +18,7 @@
 use base_db::ProcMacroKind;
 use either::Either;
 
-pub use mbe::{ExpandError, ExpandResult};
+pub use mbe::{ExpandError, ExpandResult, Origin};
 
 use std::{hash::Hash, iter, sync::Arc};
 
@@ -380,9 +380,11 @@ pub struct ExpansionInfo {
     exp_map: Arc<mbe::TokenMap>,
 }
 
-pub use mbe::Origin;
-
 impl ExpansionInfo {
+    pub fn expanded(&self) -> InFile<SyntaxNode> {
+        self.expanded.clone()
+    }
+
     pub fn call_node(&self) -> Option<InFile<SyntaxNode>> {
         Some(self.arg.with_value(self.arg.value.parent()?))
     }