Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/semantics.rs')
-rw-r--r--crates/hir/src/semantics.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir/src/semantics.rs b/crates/hir/src/semantics.rs
index d2056b1e7c..4fb449117d 100644
--- a/crates/hir/src/semantics.rs
+++ b/crates/hir/src/semantics.rs
@@ -543,6 +543,10 @@ impl<'db> SemanticsImpl<'db> {
node
}
+ pub fn to_node_syntax(&self, ptr: InFile<SyntaxNodePtr>) -> SyntaxNode {
+ ptr.value.to_node(&self.parse_or_expand(ptr.file_id))
+ }
+
pub fn to_node<N: AstNode>(&self, ptr: InFile<AstPtr<N>>) -> N {
ptr.value.to_node(&self.parse_or_expand(ptr.file_id))
}