diff options
author | Aleksey Kladov <[email protected]> | 2018-11-07 15:32:33 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-07 15:42:36 +0000 |
commit | f8b36bbc3b968754b71844d942286e81415627b8 (patch) | |
tree | 72be8cc4bac951b00746291e4b357b86def7d4c7 /crates/ra_cli | |
parent | 2119fe214303325e86174b139d7ad8193b2ce251 (diff) |
Rename File -> SourceFileNode
Diffstat (limited to 'crates/ra_cli')
-rw-r--r-- | crates/ra_cli/src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 239d846b3..5ca86df4d 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs | |||
@@ -11,7 +11,7 @@ use std::{fs, io::Read, path::Path, time::Instant}; | |||
11 | use clap::{App, Arg, SubCommand}; | 11 | use clap::{App, Arg, SubCommand}; |
12 | use join_to_string::join; | 12 | use join_to_string::join; |
13 | use ra_editor::{extend_selection, file_structure, syntax_tree}; | 13 | use ra_editor::{extend_selection, file_structure, syntax_tree}; |
14 | use ra_syntax::{File, TextRange}; | 14 | use ra_syntax::{SourceFileNode, TextRange}; |
15 | use tools::collect_tests; | 15 | use tools::collect_tests; |
16 | 16 | ||
17 | type Result<T> = ::std::result::Result<T, failure::Error>; | 17 | type Result<T> = ::std::result::Result<T, failure::Error>; |
@@ -79,9 +79,9 @@ fn main() -> Result<()> { | |||
79 | Ok(()) | 79 | Ok(()) |
80 | } | 80 | } |
81 | 81 | ||
82 | fn file() -> Result<File> { | 82 | fn file() -> Result<SourceFileNode> { |
83 | let text = read_stdin()?; | 83 | let text = read_stdin()?; |
84 | Ok(File::parse(&text)) | 84 | Ok(SourceFileNode::parse(&text)) |
85 | } | 85 | } |
86 | 86 | ||
87 | fn read_stdin() -> Result<String> { | 87 | fn read_stdin() -> Result<String> { |
@@ -100,12 +100,12 @@ fn render_test(file: &Path, line: usize) -> Result<(String, String)> { | |||
100 | None => bail!("No test found at line {} at {}", line, file.display()), | 100 | None => bail!("No test found at line {} at {}", line, file.display()), |
101 | Some((_start_line, test)) => test, | 101 | Some((_start_line, test)) => test, |
102 | }; | 102 | }; |
103 | let file = File::parse(&test.text); | 103 | let file = SourceFileNode::parse(&test.text); |
104 | let tree = syntax_tree(&file); | 104 | let tree = syntax_tree(&file); |
105 | Ok((test.text, tree)) | 105 | Ok((test.text, tree)) |
106 | } | 106 | } |
107 | 107 | ||
108 | fn selections(file: &File, start: u32, end: u32) -> String { | 108 | fn selections(file: &SourceFileNode, start: u32, end: u32) -> String { |
109 | let mut ranges = Vec::new(); | 109 | let mut ranges = Vec::new(); |
110 | let mut cur = Some(TextRange::from_to((start - 1).into(), (end - 1).into())); | 110 | let mut cur = Some(TextRange::from_to((start - 1).into(), (end - 1).into())); |
111 | while let Some(r) = cur { | 111 | while let Some(r) = cur { |