aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-28 00:42:26 +0000
committerAleksey Kladov <[email protected]>2018-11-28 00:42:26 +0000
commit0e4b710af83844f4a7c471c5335c99aaaa25a90c (patch)
treea073635942db7431b93e191aa98201a01e3fc2cd /crates/ra_db/src
parentf66e5b6e6b6f7b2b899ef4207dfe46655d77334c (diff)
introduce hir crate
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}