Update the rest of the tests

This commit is contained in:
Aleksey Kladov 2020-06-29 17:22:47 +02:00
parent e805e8c1d5
commit bbc4dc9956
9 changed files with 311 additions and 446 deletions

View file

@ -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() {