Update rowan

This commit is contained in:
Aleksey Kladov 2018-10-17 19:52:25 +03:00
parent 2a704035f4
commit 00cdde2c52
8 changed files with 26 additions and 49 deletions

View file

@ -3,10 +3,10 @@ use crate::TextRange;
use ra_syntax::{
algo::{
visit::{visitor, Visitor},
walk::{walk, WalkEvent},
},
ast::{self, NameOwner},
AstNode, File, SmolStr, SyntaxKind, SyntaxNodeRef,
WalkEvent,
};
#[derive(Debug, Clone)]
@ -54,7 +54,7 @@ pub fn file_structure(file: &File) -> Vec<StructureNode> {
let mut res = Vec::new();
let mut stack = Vec::new();
for event in walk(file.syntax()) {
for event in file.syntax().preorder() {
match event {
WalkEvent::Enter(node) => match structure_node(node) {
Some(mut symbol) => {
@ -64,7 +64,7 @@ pub fn file_structure(file: &File) -> Vec<StructureNode> {
}
None => (),
},
WalkEvent::Exit(node) => {
WalkEvent::Leave(node) => {
if structure_node(node).is_some() {
stack.pop().unwrap();
}