diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-02 16:51:39 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-02 16:51:39 +0100 |
commit | 248ee0c3fe333f9180f8c9d9dfd4efcc6886b5bc (patch) | |
tree | f94bb3a8bd47e3612ef29e815532c07d7871fa0f /crates/ra_syntax/src/yellow/syntax_text.rs | |
parent | 7ffc114dab6d1e25ead195a5937cd4f9ca51ef2c (diff) | |
parent | 1a2a8dec14ec04ea8eeccae99fd885e7a280e45b (diff) |
Merge #90
90: Inherent traversal r=matklad a=matklad
bors r+
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/yellow/syntax_text.rs')
-rw-r--r-- | crates/ra_syntax/src/yellow/syntax_text.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/yellow/syntax_text.rs b/crates/ra_syntax/src/yellow/syntax_text.rs index affd7f9c7..0db1049de 100644 --- a/crates/ra_syntax/src/yellow/syntax_text.rs +++ b/crates/ra_syntax/src/yellow/syntax_text.rs | |||
@@ -4,7 +4,6 @@ use std::{ | |||
4 | 4 | ||
5 | use { | 5 | use { |
6 | SyntaxNodeRef, TextRange, TextUnit, | 6 | SyntaxNodeRef, TextRange, TextUnit, |
7 | algo::walk::preorder, | ||
8 | text_utils::{intersect, contains_offset_nonstrict}, | 7 | text_utils::{intersect, contains_offset_nonstrict}, |
9 | }; | 8 | }; |
10 | 9 | ||
@@ -23,7 +22,8 @@ impl<'a> SyntaxText<'a> { | |||
23 | } | 22 | } |
24 | pub fn chunks(&self) -> impl Iterator<Item=&'a str> { | 23 | pub fn chunks(&self) -> impl Iterator<Item=&'a str> { |
25 | let range = self.range; | 24 | let range = self.range; |
26 | preorder(self.node) | 25 | self.node |
26 | .descendants() | ||
27 | .filter_map(move |node| { | 27 | .filter_map(move |node| { |
28 | let text = node.leaf_text()?; | 28 | let text = node.leaf_text()?; |
29 | let range = intersect(range, node.range())?; | 29 | let range = intersect(range, node.range())?; |