ruff_source_file (#6624)

This commit is contained in:
Jeong, YunWon authored and GitHub committed 2026-01-02 13:14:39 +09:00
1 parent 2e2924801c
commit 32184103c3
1 file changed
+3 -2
+3 -2
View File
@@ -1,4 +1,4 @@
pub use ruff_source_file::{LineIndex, OneIndexed as LineNumber, SourceLocation};
pub use ruff_source_file::{LineIndex, OneIndexed as LineNumber, PositionEncoding, SourceLocation};
use ruff_text_size::TextRange;
pub use ruff_text_size::TextSize;
@@ -20,7 +20,8 @@ impl<'src> SourceCode<'src> {
}
pub fn source_location(&self, offset: TextSize) -> SourceLocation {
self.index.source_location(offset, self.text)
self.index
.source_location(offset, self.text, PositionEncoding::Utf8)
}
pub fn get_range(&'src self, range: TextRange) -> &'src str {