mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
convenience api
This commit is contained in:
parent
a6df224f7d
commit
191a6ba330
8 changed files with 63 additions and 50 deletions
|
@ -156,7 +156,7 @@ fn extend_list_item(node: &SyntaxNode) -> Option<TextRange> {
|
|||
SyntaxElement::Token(it) => is_single_line_ws(it),
|
||||
})
|
||||
.next()
|
||||
.and_then(|it| it.as_token().cloned())
|
||||
.and_then(|it| it.into_token())
|
||||
.filter(|node| node.kind() == T![,])
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ fn extend_list_item(node: &SyntaxNode) -> Option<TextRange> {
|
|||
// Include any following whitespace when comma if after list item.
|
||||
let final_node = comma_node
|
||||
.next_sibling_or_token()
|
||||
.and_then(|it| it.as_token().cloned())
|
||||
.and_then(|it| it.into_token())
|
||||
.filter(|node| is_single_line_ws(node))
|
||||
.unwrap_or(comma_node);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue