diff options
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index c8f846c56..ec400ffe2 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -26,7 +26,7 @@ mod syntax_highlighting; | |||
26 | 26 | ||
27 | use std::{fmt, sync::Arc}; | 27 | use std::{fmt, sync::Arc}; |
28 | 28 | ||
29 | use ra_syntax::{SmolStr, SourceFileNode, SyntaxKind, TextRange, TextUnit}; | 29 | use ra_syntax::{SmolStr, SourceFile, TreePtr, SyntaxKind, TextRange, TextUnit}; |
30 | use ra_text_edit::TextEdit; | 30 | use ra_text_edit::TextEdit; |
31 | use rayon::prelude::*; | 31 | use rayon::prelude::*; |
32 | use relative_path::RelativePathBuf; | 32 | use relative_path::RelativePathBuf; |
@@ -308,7 +308,7 @@ impl Analysis { | |||
308 | self.db.file_text(file_id) | 308 | self.db.file_text(file_id) |
309 | } | 309 | } |
310 | /// Gets the syntax tree of the file. | 310 | /// Gets the syntax tree of the file. |
311 | pub fn file_syntax(&self, file_id: FileId) -> SourceFileNode { | 311 | pub fn file_syntax(&self, file_id: FileId) -> TreePtr<SourceFile> { |
312 | self.db.source_file(file_id).clone() | 312 | self.db.source_file(file_id).clone() |
313 | } | 313 | } |
314 | /// Gets the file's `LineIndex`: data structure to convert between absolute | 314 | /// Gets the file's `LineIndex`: data structure to convert between absolute |
@@ -322,7 +322,7 @@ impl Analysis { | |||
322 | } | 322 | } |
323 | /// Returns position of the mathcing brace (all types of braces are | 323 | /// Returns position of the mathcing brace (all types of braces are |
324 | /// supported). | 324 | /// supported). |
325 | pub fn matching_brace(&self, file: &SourceFileNode, offset: TextUnit) -> Option<TextUnit> { | 325 | pub fn matching_brace(&self, file: &SourceFile, offset: TextUnit) -> Option<TextUnit> { |
326 | ra_editor::matching_brace(file, offset) | 326 | ra_editor::matching_brace(file, offset) |
327 | } | 327 | } |
328 | /// Returns a syntax tree represented as `String`, for debug purposes. | 328 | /// Returns a syntax tree represented as `String`, for debug purposes. |
@@ -469,7 +469,7 @@ impl LibraryData { | |||
469 | files: Vec<(FileId, RelativePathBuf, Arc<String>)>, | 469 | files: Vec<(FileId, RelativePathBuf, Arc<String>)>, |
470 | ) -> LibraryData { | 470 | ) -> LibraryData { |
471 | let symbol_index = SymbolIndex::for_files(files.par_iter().map(|(file_id, _, text)| { | 471 | let symbol_index = SymbolIndex::for_files(files.par_iter().map(|(file_id, _, text)| { |
472 | let file = SourceFileNode::parse(text); | 472 | let file = SourceFile::parse(text); |
473 | (*file_id, file) | 473 | (*file_id, file) |
474 | })); | 474 | })); |
475 | let mut root_change = RootChange::default(); | 475 | let mut root_change = RootChange::default(); |