diff options
Diffstat (limited to 'crates/ra_ide_api/src/extend_selection.rs')
-rw-r--r-- | crates/ra_ide_api/src/extend_selection.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/extend_selection.rs b/crates/ra_ide_api/src/extend_selection.rs index 140820df6..f78c562af 100644 --- a/crates/ra_ide_api/src/extend_selection.rs +++ b/crates/ra_ide_api/src/extend_selection.rs | |||
@@ -2,7 +2,7 @@ use ra_db::SourceDatabase; | |||
2 | use ra_syntax::{ | 2 | use ra_syntax::{ |
3 | algo::{find_covering_element, find_token_at_offset, TokenAtOffset}, | 3 | algo::{find_covering_element, find_token_at_offset, TokenAtOffset}, |
4 | ast::{self, AstNode, AstToken}, | 4 | ast::{self, AstNode, AstToken}, |
5 | Direction, SyntaxElement, | 5 | Direction, NodeOrToken, |
6 | SyntaxKind::*, | 6 | SyntaxKind::*, |
7 | SyntaxNode, SyntaxToken, TextRange, TextUnit, T, | 7 | SyntaxNode, SyntaxToken, TextRange, TextUnit, T, |
8 | }; | 8 | }; |
@@ -53,7 +53,7 @@ fn try_extend_selection(root: &SyntaxNode, range: TextRange) -> Option<TextRange | |||
53 | return Some(leaf_range); | 53 | return Some(leaf_range); |
54 | }; | 54 | }; |
55 | let node = match find_covering_element(root, range) { | 55 | let node = match find_covering_element(root, range) { |
56 | SyntaxElement::Token(token) => { | 56 | NodeOrToken::Token(token) => { |
57 | if token.text_range() != range { | 57 | if token.text_range() != range { |
58 | return Some(token.text_range()); | 58 | return Some(token.text_range()); |
59 | } | 59 | } |
@@ -64,7 +64,7 @@ fn try_extend_selection(root: &SyntaxNode, range: TextRange) -> Option<TextRange | |||
64 | } | 64 | } |
65 | token.parent() | 65 | token.parent() |
66 | } | 66 | } |
67 | SyntaxElement::Node(node) => node, | 67 | NodeOrToken::Node(node) => node, |
68 | }; | 68 | }; |
69 | if node.text_range() != range { | 69 | if node.text_range() != range { |
70 | return Some(node.text_range()); | 70 | return Some(node.text_range()); |
@@ -153,8 +153,8 @@ fn extend_list_item(node: &SyntaxNode) -> Option<TextRange> { | |||
153 | node.siblings_with_tokens(dir) | 153 | node.siblings_with_tokens(dir) |
154 | .skip(1) | 154 | .skip(1) |
155 | .skip_while(|node| match node { | 155 | .skip_while(|node| match node { |
156 | SyntaxElement::Node(_) => false, | 156 | NodeOrToken::Node(_) => false, |
157 | SyntaxElement::Token(it) => is_single_line_ws(it), | 157 | NodeOrToken::Token(it) => is_single_line_ws(it), |
158 | }) | 158 | }) |
159 | .next() | 159 | .next() |
160 | .and_then(|it| it.into_token()) | 160 | .and_then(|it| it.into_token()) |