aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-10-17 17:53:00 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-10-17 17:53:00 +0100
commit4dbf0379ccd5c7643d48658f0ecc224add5a5c5c (patch)
treeaa44f39e0433087c2f862789ed739348f982efdb /crates/ra_editor
parent2a704035f4b36a0db737f59a7c939d17656b516f (diff)
parent00cdde2c5218020b8f6ec751042a436aeef923c7 (diff)
Merge #141
141: Update rowan r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_editor')
-rw-r--r--crates/ra_editor/src/symbols.rs6
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;
3use ra_syntax::{ 3use 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 }