aboutsummaryrefslogtreecommitdiff
path: root/crates/libeditor/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-08-11 10:28:59 +0100
committerAleksey Kladov <[email protected]>2018-08-11 10:28:59 +0100
commit7afd84febc76a75a3ed1be75c57ff35d7b8b3de6 (patch)
tree76eb2de7efc569c39cc721b7be298490b9647e0b /crates/libeditor/src/lib.rs
parentd5119133fc03694c6644cac9e307d1d496fc9bf2 (diff)
visitor
Diffstat (limited to 'crates/libeditor/src/lib.rs')
-rw-r--r--crates/libeditor/src/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/libeditor/src/lib.rs b/crates/libeditor/src/lib.rs
index 293fafae7..4ea344b17 100644
--- a/crates/libeditor/src/lib.rs
+++ b/crates/libeditor/src/lib.rs
@@ -2,16 +2,21 @@ extern crate libsyntax2;
2extern crate superslice; 2extern crate superslice;
3 3
4mod extend_selection; 4mod extend_selection;
5mod symbols;
5mod line_index; 6mod line_index;
6 7
7use libsyntax2::{ 8use libsyntax2::{
8 ast, 9 ast::{self, NameOwner},
9 SyntaxNodeRef, AstNode, 10 SyntaxNodeRef, AstNode,
10 algo::walk, 11 algo::walk,
11 SyntaxKind::*, 12 SyntaxKind::*,
12}; 13};
13pub use libsyntax2::{File, TextRange, TextUnit}; 14pub use libsyntax2::{File, TextRange, TextUnit};
14pub use self::line_index::{LineIndex, LineCol}; 15pub use self::{
16 line_index::{LineIndex, LineCol},
17 extend_selection::extend_selection,
18 symbols::{FileSymbol, file_symbols}
19};
15 20
16#[derive(Debug)] 21#[derive(Debug)]
17pub struct HighlightedRange { 22pub struct HighlightedRange {
@@ -108,11 +113,6 @@ pub fn symbols(file: &ast::File) -> Vec<Symbol> {
108 res // NLL :-( 113 res // NLL :-(
109} 114}
110 115
111pub fn extend_selection(file: &ast::File, range: TextRange) -> Option<TextRange> {
112 let syntax = file.syntax();
113 extend_selection::extend_selection(syntax.as_ref(), range)
114}
115
116pub fn runnables(file: &ast::File) -> Vec<Runnable> { 116pub fn runnables(file: &ast::File) -> Vec<Runnable> {
117 file 117 file
118 .functions() 118 .functions()