diff options
author | Aleksey Kladov <[email protected]> | 2019-09-25 15:57:12 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-09-25 15:57:12 +0100 |
commit | a525e830a62272d21fbb0fb1c20bfa865791512d (patch) | |
tree | 528212ba4d092c961b68e3591f53988c5b5e6a7d /crates/ra_syntax/src/ast | |
parent | a452e50e0e89390b8a055f0c7c64100e9872edac (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.rs | 9 |
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 | ||
376 | impl 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 | |||
376 | impl ast::WherePred { | 385 | impl ast::WherePred { |
377 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | 386 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
378 | self.syntax() | 387 | self.syntax() |