aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/utils.rs')
-rw-r--r--crates/ra_syntax/src/utils.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/utils.rs b/crates/ra_syntax/src/utils.rs
index 27248ff32..7d0ef2fa2 100644
--- a/crates/ra_syntax/src/utils.rs
+++ b/crates/ra_syntax/src/utils.rs
@@ -1,6 +1,5 @@
1use crate::{ 1use crate::{
2 algo::walk::{walk, WalkEvent}, 2 File, SyntaxKind, SyntaxNodeRef, WalkEvent
3 File, SyntaxKind, SyntaxNodeRef,
4}; 3};
5use std::fmt::Write; 4use std::fmt::Write;
6 5
@@ -19,7 +18,7 @@ pub fn dump_tree(syntax: SyntaxNodeRef) -> String {
19 }; 18 };
20 } 19 }
21 20
22 for event in walk(syntax) { 21 for event in syntax.preorder() {
23 match event { 22 match event {
24 WalkEvent::Enter(node) => { 23 WalkEvent::Enter(node) => {
25 indent!(); 24 indent!();
@@ -34,7 +33,7 @@ pub fn dump_tree(syntax: SyntaxNodeRef) -> String {
34 } 33 }
35 level += 1; 34 level += 1;
36 } 35 }
37 WalkEvent::Exit(_) => level -= 1, 36 WalkEvent::Leave(_) => level -= 1,
38 } 37 }
39 } 38 }
40 39