mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
add new editing API, suitable for modifying several nodes at once
This commit is contained in:
parent
a452e50e0e
commit
a525e830a6
7 changed files with 119 additions and 29 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue