mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Make replace_derive_with_manual_impl work again
This commit is contained in:
parent
be3168dabe
commit
f13c98034b
9 changed files with 118 additions and 130 deletions
|
@ -705,6 +705,15 @@ impl ast::RangePat {
|
|||
}
|
||||
|
||||
impl ast::TokenTree {
|
||||
pub fn token_trees_and_tokens(
|
||||
&self,
|
||||
) -> impl Iterator<Item = NodeOrToken<ast::TokenTree, SyntaxToken>> {
|
||||
self.syntax().children_with_tokens().filter_map(|not| match not {
|
||||
NodeOrToken::Node(node) => ast::TokenTree::cast(node).map(NodeOrToken::Node),
|
||||
NodeOrToken::Token(t) => Some(NodeOrToken::Token(t)),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn left_delimiter_token(&self) -> Option<SyntaxToken> {
|
||||
self.syntax()
|
||||
.first_child_or_token()?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue