mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
ruff_source_file (#6624)
This commit is contained in:
1 parent
2e2924801c
commit
32184103c3
1 file changed
+3
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user