aboutsummaryrefslogtreecommitdiff
path: root/crates/libeditor/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libeditor/src/lib.rs')
-rw-r--r--crates/libeditor/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/libeditor/src/lib.rs b/crates/libeditor/src/lib.rs
index b2e2c4782..06dac9d6d 100644
--- a/crates/libeditor/src/lib.rs
+++ b/crates/libeditor/src/lib.rs
@@ -18,7 +18,7 @@ mod test_utils;
18 18
19use libsyntax2::{ 19use libsyntax2::{
20 File, TextUnit, TextRange, SyntaxNodeRef, 20 File, TextUnit, TextRange, SyntaxNodeRef,
21 ast::{AstNode, NameOwner}, 21 ast::{self, AstNode, NameOwner},
22 algo::{walk, find_leaf_at_offset, ancestors}, 22 algo::{walk, find_leaf_at_offset, ancestors},
23 SyntaxKind::{self, *}, 23 SyntaxKind::{self, *},
24}; 24};
@@ -126,8 +126,8 @@ pub fn syntax_tree(file: &File) -> String {
126} 126}
127 127
128pub fn runnables(file: &File) -> Vec<Runnable> { 128pub fn runnables(file: &File) -> Vec<Runnable> {
129 file.ast() 129 walk::preorder(file.syntax())
130 .functions() 130 .filter_map(ast::FnDef::cast)
131 .filter_map(|f| { 131 .filter_map(|f| {
132 let name = f.name()?.text(); 132 let name = f.name()?.text();
133 let kind = if name == "main" { 133 let kind = if name == "main" {