diff options
author | Aleksey Kladov <[email protected]> | 2018-11-28 00:42:26 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-11-28 00:42:26 +0000 |
commit | 0e4b710af83844f4a7c471c5335c99aaaa25a90c (patch) | |
tree | a073635942db7431b93e191aa98201a01e3fc2cd /crates/ra_db/src | |
parent | f66e5b6e6b6f7b2b899ef4207dfe46655d77334c (diff) |
introduce hir crate
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 | } | ||