MCPcopy Index your code
hub / github.com/RustPython/RustPython / source_location

Method source_location

crates/compiler-source/src/lib.rs:22–25  ·  view source on GitHub ↗
(&self, offset: TextSize)

Source from the content-addressed store, hash-verified

20 }
21
22 pub fn source_location(&self, offset: TextSize) -> SourceLocation {
23 self.index
24 .source_location(offset, self.text, PositionEncoding::Utf8)
25 }
26
27 pub fn get_range(&'src self, range: TextRange) -> &'src str {
28 &self.text[range.start().to_usize()..range.end().to_usize()]

Callers 11

from_ruff_parse_errorMethod · 0.80
scan_parameterMethod · 0.80
scan_statementMethod · 0.80
scan_expressionMethod · 0.80
scan_comprehensionMethod · 0.80
scan_type_paramsMethod · 0.80
check_nameMethod · 0.80
register_nameMethod · 0.80
eprint_locationFunction · 0.80
error_rangedMethod · 0.80
_emitMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected