aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/yellow
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/yellow')
-rw-r--r--crates/ra_syntax/src/yellow/builder.rs2
-rw-r--r--crates/ra_syntax/src/yellow/mod.rs14
-rw-r--r--crates/ra_syntax/src/yellow/syntax_text.rs2
3 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_syntax/src/yellow/builder.rs b/crates/ra_syntax/src/yellow/builder.rs
index c307b2bd0..67a1a382b 100644
--- a/crates/ra_syntax/src/yellow/builder.rs
+++ b/crates/ra_syntax/src/yellow/builder.rs
@@ -1,5 +1,5 @@
1use rowan::GreenNodeBuilder; 1use rowan::GreenNodeBuilder;
2use { 2use crate::{
3 TextUnit, SmolStr, 3 TextUnit, SmolStr,
4 parser_impl::Sink, 4 parser_impl::Sink,
5 yellow::{GreenNode, SyntaxError, RaTypes}, 5 yellow::{GreenNode, SyntaxError, RaTypes},
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};
8use rowan::Types; 8use rowan::Types;
9use {SyntaxKind, TextUnit, TextRange, SmolStr}; 9use crate::{SyntaxKind, TextUnit, TextRange, SmolStr};
10use self::syntax_text::SyntaxText; 10use self::syntax_text::SyntaxText;
11 11
12pub use rowan::{TreeRoot}; 12pub 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
158fn has_short_text(kind: SyntaxKind) -> bool { 158fn 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,
diff --git a/crates/ra_syntax/src/yellow/syntax_text.rs b/crates/ra_syntax/src/yellow/syntax_text.rs
index 0db1049de..ae33b993d 100644
--- a/crates/ra_syntax/src/yellow/syntax_text.rs
+++ b/crates/ra_syntax/src/yellow/syntax_text.rs
@@ -2,7 +2,7 @@ use std::{
2 fmt, ops, 2 fmt, ops,
3}; 3};
4 4
5use { 5use crate::{
6 SyntaxNodeRef, TextRange, TextUnit, 6 SyntaxNodeRef, TextRange, TextUnit,
7 text_utils::{intersect, contains_offset_nonstrict}, 7 text_utils::{intersect, contains_offset_nonstrict},
8}; 8};