mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Update the rest of the tests
This commit is contained in:
parent
e805e8c1d5
commit
bbc4dc9956
9 changed files with 311 additions and 446 deletions
|
@ -41,6 +41,10 @@ pub fn find_node_at_offset<N: AstNode>(syntax: &SyntaxNode, offset: TextSize) ->
|
|||
ancestors_at_offset(syntax, offset).find_map(N::cast)
|
||||
}
|
||||
|
||||
pub fn find_node_at_range<N: AstNode>(syntax: &SyntaxNode, range: TextRange) -> Option<N> {
|
||||
find_covering_element(syntax, range).ancestors().find_map(N::cast)
|
||||
}
|
||||
|
||||
/// Skip to next non `trivia` token
|
||||
pub fn skip_trivia_token(mut token: SyntaxToken, direction: Direction) -> Option<SyntaxToken> {
|
||||
while token.kind().is_trivia() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue