From 220d285b4afb250e59a08e9b1ad38c2fc2275782 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Aug 2018 11:44:58 +0300 Subject: rename ParsedFile -> File --- crates/libeditor/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/libeditor/src/lib.rs') diff --git a/crates/libeditor/src/lib.rs b/crates/libeditor/src/lib.rs index 681cca81d..a6e6deba7 100644 --- a/crates/libeditor/src/lib.rs +++ b/crates/libeditor/src/lib.rs @@ -14,7 +14,7 @@ use libsyntax2::{ algo::{walk, find_leaf_at_offset}, SyntaxKind::{self, *}, }; -pub use libsyntax2::{ParsedFile, TextRange, TextUnit}; +pub use libsyntax2::{File, TextRange, TextUnit}; pub use self::{ line_index::{LineIndex, LineCol}, extend_selection::extend_selection, @@ -51,11 +51,11 @@ pub enum RunnableKind { Bin, } -pub fn parse(text: &str) -> ParsedFile { - ParsedFile::parse(text) +pub fn parse(text: &str) -> File { + File::parse(text) } -pub fn matching_brace(file: &ParsedFile, offset: TextUnit) -> Option { +pub fn matching_brace(file: &File, offset: TextUnit) -> Option { const BRACES: &[SyntaxKind] = &[ L_CURLY, R_CURLY, L_BRACK, R_BRACK, @@ -75,7 +75,7 @@ pub fn matching_brace(file: &ParsedFile, offset: TextUnit) -> Option { Some(matching_node.range().start()) } -pub fn highlight(file: &ParsedFile) -> Vec { +pub fn highlight(file: &File) -> Vec { let mut res = Vec::new(); for node in walk::preorder(file.syntax()) { let tag = match node.kind() { @@ -98,7 +98,7 @@ pub fn highlight(file: &ParsedFile) -> Vec { res } -pub fn diagnostics(file: &ParsedFile) -> Vec { +pub fn diagnostics(file: &File) -> Vec { let mut res = Vec::new(); for node in walk::preorder(file.syntax()) { @@ -116,11 +116,11 @@ pub fn diagnostics(file: &ParsedFile) -> Vec { res } -pub fn syntax_tree(file: &ParsedFile) -> String { +pub fn syntax_tree(file: &File) -> String { ::libsyntax2::utils::dump_tree(file.syntax()) } -pub fn runnables(file: &ParsedFile) -> Vec { +pub fn runnables(file: &File) -> Vec { file.ast() .functions() .filter_map(|f| { -- cgit v1.2.3