aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-25 15:57:12 +0100
committerAleksey Kladov <[email protected]>2019-09-25 15:57:12 +0100
commita525e830a62272d21fbb0fb1c20bfa865791512d (patch)
tree528212ba4d092c961b68e3591f53988c5b5e6a7d /crates/ra_syntax/src/ast
parenta452e50e0e89390b8a055f0c7c64100e9872edac (diff)
add new editing API, suitable for modifying several nodes at once
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/extensions.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs
index d3a375f87..5f7e9f5b1 100644
--- a/crates/ra_syntax/src/ast/extensions.rs
+++ b/crates/ra_syntax/src/ast/extensions.rs
@@ -373,6 +373,15 @@ impl ast::LifetimeParam {
373 } 373 }
374} 374}
375 375
376impl ast::TypeParam {
377 pub fn colon_token(&self) -> Option<SyntaxToken> {
378 self.syntax()
379 .children_with_tokens()
380 .filter_map(|it| it.into_token())
381 .find(|it| it.kind() == T![:])
382 }
383}
384
376impl ast::WherePred { 385impl ast::WherePred {
377 pub fn lifetime_token(&self) -> Option<SyntaxToken> { 386 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
378 self.syntax() 387 self.syntax()