diff options
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r-- | crates/ra_db/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index c5587c950..33cb0e2ec 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -13,7 +13,7 @@ mod loc2id; | |||
13 | 13 | ||
14 | use std::sync::Arc; | 14 | use std::sync::Arc; |
15 | use ra_editor::LineIndex; | 15 | use ra_editor::LineIndex; |
16 | use ra_syntax::SourceFileNode; | 16 | use ra_syntax::{TextUnit, SourceFileNode}; |
17 | 17 | ||
18 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] | 18 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] |
19 | pub struct Canceled; | 19 | pub struct Canceled; |
@@ -81,3 +81,9 @@ fn file_lines(db: &impl SyntaxDatabase, file_id: FileId) -> Arc<LineIndex> { | |||
81 | let text = db.file_text(file_id); | 81 | let text = db.file_text(file_id); |
82 | Arc::new(LineIndex::new(&*text)) | 82 | Arc::new(LineIndex::new(&*text)) |
83 | } | 83 | } |
84 | |||
85 | #[derive(Clone, Copy, Debug)] | ||
86 | pub struct FilePosition { | ||
87 | pub file_id: FileId, | ||
88 | pub offset: TextUnit, | ||
89 | } | ||