aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r--crates/ra_db/src/lib.rs8
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
14use std::sync::Arc; 14use std::sync::Arc;
15use ra_editor::LineIndex; 15use ra_editor::LineIndex;
16use ra_syntax::SourceFileNode; 16use 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)]
19pub struct Canceled; 19pub 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)]
86pub struct FilePosition {
87 pub file_id: FileId,
88 pub offset: TextUnit,
89}