diff options
Diffstat (limited to 'crates/ra_editor/src')
-rw-r--r-- | crates/ra_editor/src/symbols.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_editor/src/symbols.rs b/crates/ra_editor/src/symbols.rs index b768b34bc..c3c66680d 100644 --- a/crates/ra_editor/src/symbols.rs +++ b/crates/ra_editor/src/symbols.rs | |||
@@ -3,10 +3,10 @@ use crate::TextRange; | |||
3 | use ra_syntax::{ | 3 | use ra_syntax::{ |
4 | algo::{ | 4 | algo::{ |
5 | visit::{visitor, Visitor}, | 5 | visit::{visitor, Visitor}, |
6 | walk::{walk, WalkEvent}, | ||
7 | }, | 6 | }, |
8 | ast::{self, NameOwner}, | 7 | ast::{self, NameOwner}, |
9 | AstNode, File, SmolStr, SyntaxKind, SyntaxNodeRef, | 8 | AstNode, File, SmolStr, SyntaxKind, SyntaxNodeRef, |
9 | WalkEvent, | ||
10 | }; | 10 | }; |
11 | 11 | ||
12 | #[derive(Debug, Clone)] | 12 | #[derive(Debug, Clone)] |
@@ -54,7 +54,7 @@ pub fn file_structure(file: &File) -> Vec<StructureNode> { | |||
54 | let mut res = Vec::new(); | 54 | let mut res = Vec::new(); |
55 | let mut stack = Vec::new(); | 55 | let mut stack = Vec::new(); |
56 | 56 | ||
57 | for event in walk(file.syntax()) { | 57 | for event in file.syntax().preorder() { |
58 | match event { | 58 | match event { |
59 | WalkEvent::Enter(node) => match structure_node(node) { | 59 | WalkEvent::Enter(node) => match structure_node(node) { |
60 | Some(mut symbol) => { | 60 | Some(mut symbol) => { |
@@ -64,7 +64,7 @@ pub fn file_structure(file: &File) -> Vec<StructureNode> { | |||
64 | } | 64 | } |
65 | None => (), | 65 | None => (), |
66 | }, | 66 | }, |
67 | WalkEvent::Exit(node) => { | 67 | WalkEvent::Leave(node) => { |
68 | if structure_node(node).is_some() { | 68 | if structure_node(node).is_some() { |
69 | stack.pop().unwrap(); | 69 | stack.pop().unwrap(); |
70 | } | 70 | } |