simplify
This commit is contained in:
@@ -5,11 +5,12 @@ mod extend_selection;
|
||||
mod line_index;
|
||||
|
||||
use libsyntax2::{
|
||||
ast,
|
||||
SyntaxNodeRef, AstNode,
|
||||
algo::walk,
|
||||
SyntaxKind::*,
|
||||
};
|
||||
pub use libsyntax2::{TextRange, TextUnit, ast};
|
||||
pub use libsyntax2::{File, TextRange, TextUnit};
|
||||
pub use self::line_index::{LineIndex, LineCol};
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -43,6 +44,10 @@ pub enum RunnableKind {
|
||||
Bin,
|
||||
}
|
||||
|
||||
pub fn parse(text: &str) -> ast::File {
|
||||
ast::File::parse(text)
|
||||
}
|
||||
|
||||
pub fn highlight(file: &ast::File) -> Vec<HighlightedRange> {
|
||||
let syntax = file.syntax();
|
||||
let mut res = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user