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