diff options
Diffstat (limited to 'crates/ra_syntax/src/yellow/mod.rs')
-rw-r--r-- | crates/ra_syntax/src/yellow/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_syntax/src/yellow/mod.rs b/crates/ra_syntax/src/yellow/mod.rs index 710320f47..ab9bca0f0 100644 --- a/crates/ra_syntax/src/yellow/mod.rs +++ b/crates/ra_syntax/src/yellow/mod.rs | |||
@@ -6,7 +6,7 @@ use std::{ | |||
6 | hash::{Hash, Hasher}, | 6 | hash::{Hash, Hasher}, |
7 | }; | 7 | }; |
8 | use rowan::Types; | 8 | use rowan::Types; |
9 | use {SyntaxKind, TextUnit, TextRange, SmolStr}; | 9 | use crate::{SyntaxKind, TextUnit, TextRange, SmolStr}; |
10 | use self::syntax_text::SyntaxText; | 10 | use self::syntax_text::SyntaxText; |
11 | 11 | ||
12 | pub use rowan::{TreeRoot}; | 12 | pub use rowan::{TreeRoot}; |
@@ -70,16 +70,16 @@ impl<'a> SyntaxNodeRef<'a> { | |||
70 | self.0.leaf_text() | 70 | self.0.leaf_text() |
71 | } | 71 | } |
72 | pub fn ancestors(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> { | 72 | pub fn ancestors(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> { |
73 | ::algo::generate(Some(self), |&node| node.parent()) | 73 | crate::algo::generate(Some(self), |&node| node.parent()) |
74 | } | 74 | } |
75 | pub fn descendants(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> { | 75 | pub fn descendants(self) -> impl Iterator<Item=SyntaxNodeRef<'a>> { |
76 | ::algo::walk::walk(self).filter_map(|event| match event { | 76 | crate::algo::walk::walk(self).filter_map(|event| match event { |
77 | ::algo::walk::WalkEvent::Enter(node) => Some(node), | 77 | crate::algo::walk::WalkEvent::Enter(node) => Some(node), |
78 | ::algo::walk::WalkEvent::Exit(_) => None, | 78 | crate::algo::walk::WalkEvent::Exit(_) => None, |
79 | }) | 79 | }) |
80 | } | 80 | } |
81 | pub fn siblings(self, direction: Direction) -> impl Iterator<Item=SyntaxNodeRef<'a>> { | 81 | pub fn siblings(self, direction: Direction) -> impl Iterator<Item=SyntaxNodeRef<'a>> { |
82 | ::algo::generate(Some(self), move |&node| match direction { | 82 | crate::algo::generate(Some(self), move |&node| match direction { |
83 | Direction::Next => node.next_sibling(), | 83 | Direction::Next => node.next_sibling(), |
84 | Direction::Prev => node.prev_sibling(), | 84 | Direction::Prev => node.prev_sibling(), |
85 | }) | 85 | }) |
@@ -156,7 +156,7 @@ impl<R: TreeRoot<RaTypes>> Iterator for SyntaxNodeChildren<R> { | |||
156 | 156 | ||
157 | 157 | ||
158 | fn has_short_text(kind: SyntaxKind) -> bool { | 158 | fn has_short_text(kind: SyntaxKind) -> bool { |
159 | use SyntaxKind::*; | 159 | use crate::SyntaxKind::*; |
160 | match kind { | 160 | match kind { |
161 | IDENT | LIFETIME | INT_NUMBER | FLOAT_NUMBER => true, | 161 | IDENT | LIFETIME | INT_NUMBER | FLOAT_NUMBER => true, |
162 | _ => false, | 162 | _ => false, |