MCPcopy Create free account
hub / github.com/astral-sh/ruff / compute_position

Method compute_position

crates/ruff_python_parser/src/string.rs:127–129  ·  view source on GitHub ↗
(&self, cursor: usize)

Source from the content-addressed store, hash-verified

125 /// Computes the position of the cursor considering the offset.
126 #[inline]
127 fn compute_position(&self, cursor: usize) -> TextSize {
128 self.offset + TextSize::try_from(cursor).unwrap()
129 }
130
131 /// Returns the next byte in the string, if there is one.
132 ///

Callers 3

positionMethod · 0.80
parse_unicode_nameMethod · 0.80
parse_bytesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected