mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
introduce hir crate
This commit is contained in:
parent
f66e5b6e6b
commit
0e4b710af8
14 changed files with 2270 additions and 17 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue