From d6020f516f2826dac7188171241e9a72d6248cf8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 7 Jan 2019 17:06:54 +0300 Subject: migrate ra_cli to new rowan --- crates/ra_cli/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_cli/src') diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index a3b856aa9..0d12f3a88 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -3,7 +3,7 @@ use std::{fs, io::Read, path::Path, time::Instant}; use clap::{App, Arg, SubCommand}; use join_to_string::join; use ra_editor::{extend_selection, file_structure, syntax_tree}; -use ra_syntax::{SourceFileNode, TextRange}; +use ra_syntax::{SourceFile, TextRange, TreePtr, AstNode}; use tools::collect_tests; type Result = ::std::result::Result; @@ -71,9 +71,9 @@ fn main() -> Result<()> { Ok(()) } -fn file() -> Result { +fn file() -> Result> { let text = read_stdin()?; - Ok(SourceFileNode::parse(&text)) + Ok(SourceFile::parse(&text)) } fn read_stdin() -> Result { @@ -92,12 +92,12 @@ fn render_test(file: &Path, line: usize) -> Result<(String, String)> { None => failure::bail!("No test found at line {} at {}", line, file.display()), Some((_start_line, test)) => test, }; - let file = SourceFileNode::parse(&test.text); + let file = SourceFile::parse(&test.text); let tree = syntax_tree(&file); Ok((test.text, tree)) } -fn selections(file: &SourceFileNode, start: u32, end: u32) -> String { +fn selections(file: &SourceFile, start: u32, end: u32) -> String { let mut ranges = Vec::new(); let mut cur = Some(TextRange::from_to((start - 1).into(), (end - 1).into())); while let Some(r) = cur { -- cgit v1.2.3