aboutsummaryrefslogtreecommitdiff
path: root/crates/libeditor/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-28 17:23:55 +0100
committerAleksey Kladov <[email protected]>2018-08-28 17:23:55 +0100
commit537ea620bb2a73a5e79872f414af23cf4bf03179 (patch)
tree875b5c789e027615be5466a74bf7053a6798da0d /crates/libeditor/src/lib.rs
parentd34588bf83898870d7f9b4b49ac2a5f71c77dabb (diff)
complete items from module scope
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" {