add new editing API, suitable for modifying several nodes at once

This commit is contained in:
Aleksey Kladov 2019-09-25 17:57:12 +03:00
parent a452e50e0e
commit a525e830a6
7 changed files with 119 additions and 29 deletions

View file

@ -373,6 +373,15 @@ impl ast::LifetimeParam {
}
}
impl ast::TypeParam {
pub fn colon_token(&self) -> Option<SyntaxToken> {
self.syntax()
.children_with_tokens()
.filter_map(|it| it.into_token())
.find(|it| it.kind() == T![:])
}
}
impl ast::WherePred {
pub fn lifetime_token(&self) -> Option<SyntaxToken> {
self.syntax()