Skip to content

Commit 7e70e0c

Browse files
committed
ruff_source_file
1 parent 2e29248 commit 7e70e0c

File tree

1 file changed

+3
-2
lines changed
  • crates/compiler-source/src

1 file changed

+3
-2
lines changed

crates/compiler-source/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub use ruff_source_file::{LineIndex, OneIndexed as LineNumber, SourceLocation};
1+
pub use ruff_source_file::{LineIndex, OneIndexed as LineNumber, PositionEncoding, SourceLocation};
22
use ruff_text_size::TextRange;
33
pub use ruff_text_size::TextSize;
44

@@ -20,7 +20,8 @@ impl<'src> SourceCode<'src> {
2020
}
2121

2222
pub fn source_location(&self, offset: TextSize) -> SourceLocation {
23-
self.index.source_location(offset, self.text)
23+
self.index
24+
.source_location(offset, self.text, PositionEncoding::Utf8)
2425
}
2526

2627
pub fn get_range(&'src self, range: TextRange) -> &'src str {

0 commit comments

Comments
 (0)