diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-25 21:44:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-25 21:44:20 +0100 |
commit | 870ce4b1a50a07e3a536ab26215804acdfc9ba8a (patch) | |
tree | 2ea0c53b6d7b09998dbc0b32d4552aeb30d210ed /crates/ra_syntax/src/ast | |
parent | 0d277faf6c4052dcc80037fc43b4986980d0814b (diff) | |
parent | a525e830a62272d21fbb0fb1c20bfa865791512d (diff) |
Merge #1912
1912: add new editing API, suitable for modifying several nodes at once r=viorina a=matklad
r? @viorina
Co-authored-by: Aleksey Kladov <[email protected]>
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() |