mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Update rowan
This commit is contained in:
parent
2a704035f4
commit
00cdde2c52
8 changed files with 26 additions and 49 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue