only rust changes reset scene (#6060)

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-03-29 11:43:42 -07:00
committed by GitHub
parent 6532b23f1c
commit 51c16d0048
5 changed files with 126 additions and 8 deletions

View File

@ -211,6 +211,14 @@ impl Program {
pub fn recast_with_options(&self, options: &FormatOptions) -> String {
self.ast.recast(options, 0)
}
/// Create an empty program.
pub fn empty() -> Self {
Self {
ast: parsing::ast::types::Node::no_src(parsing::ast::types::Program::default()),
original_file_contents: String::new(),
}
}
}
#[inline]