introduce hir crate

This commit is contained in:
Aleksey Kladov 2018-11-28 03:42:26 +03:00
parent f66e5b6e6b
commit 0e4b710af8
14 changed files with 2270 additions and 17 deletions

View file

@ -13,7 +13,7 @@ mod loc2id;
use std::sync::Arc;
use ra_editor::LineIndex;
use ra_syntax::SourceFileNode;
use ra_syntax::{TextUnit, SourceFileNode};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Canceled;
@ -81,3 +81,9 @@ fn file_lines(db: &impl SyntaxDatabase, file_id: FileId) -> Arc<LineIndex> {
let text = db.file_text(file_id);
Arc::new(LineIndex::new(&*text))
}
#[derive(Clone, Copy, Debug)]
pub struct FilePosition {
pub file_id: FileId,
pub offset: TextUnit,
}