We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e29248 commit 7e70e0cCopy full SHA for 7e70e0c
crates/compiler-source/src/lib.rs
@@ -1,4 +1,4 @@
1
-pub use ruff_source_file::{LineIndex, OneIndexed as LineNumber, SourceLocation};
+pub use ruff_source_file::{LineIndex, OneIndexed as LineNumber, PositionEncoding, SourceLocation};
2
use ruff_text_size::TextRange;
3
pub use ruff_text_size::TextSize;
4
@@ -20,7 +20,8 @@ impl<'src> SourceCode<'src> {
20
}
21
22
pub fn source_location(&self, offset: TextSize) -> SourceLocation {
23
- self.index.source_location(offset, self.text)
+ self.index
24
+ .source_location(offset, self.text, PositionEncoding::Utf8)
25
26
27
pub fn get_range(&'src self, range: TextRange) -> &'src str {
0 commit comments