diff options
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 771a349c8..48df08416 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -29,22 +29,27 @@ use std::{fmt, sync::Arc}; | |||
29 | 29 | ||
30 | use ra_syntax::{SmolStr, SourceFile, TreePtr, SyntaxKind, TextRange, TextUnit}; | 30 | use ra_syntax::{SmolStr, SourceFile, TreePtr, SyntaxKind, TextRange, TextUnit}; |
31 | use ra_text_edit::TextEdit; | 31 | use ra_text_edit::TextEdit; |
32 | use ra_db::{SyntaxDatabase, FilesDatabase, LocalSyntaxPtr}; | ||
32 | use rayon::prelude::*; | 33 | use rayon::prelude::*; |
33 | use relative_path::RelativePathBuf; | 34 | use relative_path::RelativePathBuf; |
34 | use rustc_hash::FxHashMap; | 35 | use rustc_hash::FxHashMap; |
35 | use salsa::ParallelDatabase; | 36 | use salsa::ParallelDatabase; |
36 | 37 | ||
37 | use crate::symbol_index::{FileSymbol, SymbolIndex}; | 38 | use crate::{ |
39 | symbol_index::{FileSymbol, SymbolIndex}, | ||
40 | db::LineIndexDatabase, | ||
41 | }; | ||
38 | 42 | ||
39 | pub use crate::{ | 43 | pub use crate::{ |
40 | completion::{CompletionItem, CompletionItemKind, InsertText}, | 44 | completion::{CompletionItem, CompletionItemKind, InsertText}, |
41 | runnables::{Runnable, RunnableKind}, | 45 | runnables::{Runnable, RunnableKind}, |
42 | }; | 46 | }; |
43 | pub use ra_editor::{Fold, FoldKind, HighlightedRange, LineIndex, Severity, StructureNode}; | 47 | pub use ra_editor::{ |
44 | 48 | Fold, FoldKind, HighlightedRange, Severity, StructureNode, | |
49 | LineIndex, LineCol, translate_offset_with_edit, | ||
50 | }; | ||
45 | pub use ra_db::{ | 51 | pub use ra_db::{ |
46 | Cancelable, Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, FilesDatabase, | 52 | Cancelable, Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId |
47 | LocalSyntaxPtr, SourceRootId, SyntaxDatabase, | ||
48 | }; | 53 | }; |
49 | 54 | ||
50 | #[derive(Default)] | 55 | #[derive(Default)] |
@@ -322,7 +327,7 @@ impl Analysis { | |||
322 | /// Gets the file's `LineIndex`: data structure to convert between absolute | 327 | /// Gets the file's `LineIndex`: data structure to convert between absolute |
323 | /// offsets and line/column representation. | 328 | /// offsets and line/column representation. |
324 | pub fn file_line_index(&self, file_id: FileId) -> Arc<LineIndex> { | 329 | pub fn file_line_index(&self, file_id: FileId) -> Arc<LineIndex> { |
325 | self.db.file_lines(file_id) | 330 | self.db.line_index(file_id) |
326 | } | 331 | } |
327 | /// Selects the next syntactic nodes encopasing the range. | 332 | /// Selects the next syntactic nodes encopasing the range. |
328 | pub fn extend_selection(&self, frange: FileRange) -> TextRange { | 333 | pub fn extend_selection(&self, frange: FileRange) -> TextRange { |