Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/map.rs')
| -rw-r--r-- | crates/span/src/map.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/span/src/map.rs b/crates/span/src/map.rs index 81fc56c961..6269f4c30c 100644 --- a/crates/span/src/map.rs +++ b/crates/span/src/map.rs @@ -4,11 +4,10 @@ use std::{fmt, hash::Hash}; use stdx::{always, itertools::Itertools}; -use vfs::FileId; use crate::{ - ErasedFileAstId, Span, SpanAnchor, SpanData, SyntaxContextId, TextRange, TextSize, - ROOT_ERASED_FILE_AST_ID, + EditionedFileId, ErasedFileAstId, Span, SpanAnchor, SpanData, SyntaxContextId, TextRange, + TextSize, ROOT_ERASED_FILE_AST_ID, }; /// Maps absolute text ranges for the corresponding file to the relevant span data. @@ -109,7 +108,7 @@ where #[derive(PartialEq, Eq, Hash, Debug)] pub struct RealSpanMap { - file_id: FileId, + file_id: EditionedFileId, /// Invariant: Sorted vec over TextSize // FIXME: SortedVec<(TextSize, ErasedFileAstId)>? pairs: Box<[(TextSize, ErasedFileAstId)]>, @@ -128,7 +127,7 @@ impl fmt::Display for RealSpanMap { impl RealSpanMap { /// Creates a real file span map that returns absolute ranges (relative ranges to the root ast id). - pub fn absolute(file_id: FileId) -> Self { + pub fn absolute(file_id: EditionedFileId) -> Self { RealSpanMap { file_id, pairs: Box::from([(TextSize::new(0), ROOT_ERASED_FILE_AST_ID)]), @@ -137,7 +136,7 @@ impl RealSpanMap { } pub fn from_file( - file_id: FileId, + file_id: EditionedFileId, pairs: Box<[(TextSize, ErasedFileAstId)]>, end: TextSize, ) -> Self { |