rewrite merge use trees assist to use muatable syntax trees

changelog internal
This commit is contained in:
Aleksey Kladov
2021-03-18 12:57:55 +03:00
parent d834306e7c
commit 9cbf09ec4f
7 changed files with 116 additions and 83 deletions

View File

@@ -560,7 +560,7 @@ pub mod tokens {
pub fn whitespace(text: &str) -> SyntaxToken {
assert!(text.trim().is_empty());
let sf = SourceFile::parse(text).ok().unwrap();
sf.syntax().first_child_or_token().unwrap().into_token().unwrap()
sf.syntax().clone_for_update().first_child_or_token().unwrap().into_token().unwrap()
}
pub fn doc_comment(text: &str) -> SyntaxToken {