Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/syntax_factory/constructors.rs')
-rw-r--r--crates/syntax/src/ast/syntax_factory/constructors.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/syntax_factory/constructors.rs b/crates/syntax/src/ast/syntax_factory/constructors.rs
index 44114a7802..44ab64d4f6 100644
--- a/crates/syntax/src/ast/syntax_factory/constructors.rs
+++ b/crates/syntax/src/ast/syntax_factory/constructors.rs
@@ -2053,6 +2053,17 @@ impl SyntaxFactory {
self.path_unqualified(self.path_segment(self.name_ref(ident)))
}
+ pub fn path_from_idents<'a>(
+ &self,
+ parts: impl IntoIterator<Item = &'a str>,
+ ) -> Option<ast::Path> {
+ make::ext::path_from_idents(parts).map(|path| path.clone_for_update())
+ }
+
+ pub fn token_tree_from_node(&self, node: &SyntaxNode) -> ast::TokenTree {
+ make::ext::token_tree_from_node(node).clone_for_update()
+ }
+
pub fn expr_unit(&self) -> ast::Expr {
self.expr_tuple([]).into()
}