MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / utf16_len

Function utf16_len

codegraph-kernel/src/textutil.rs:94–96  ·  view source on GitHub ↗

UTF-16 code units in `s` — what web-tree-sitter (and JS string ops) count, so kernel-emitted columns are byte-identical to the wasm path's.

(s: &str)

Source from the content-addressed store, hash-verified

92/// UTF-16 code units in `s` — what web-tree-sitter (and JS string ops)
93/// count, so kernel-emitted columns are byte-identical to the wasm path's.
94pub fn utf16_len(s: &str) -> usize {
95 s.chars().map(|c| c.len_utf16()).sum()
96}
97
98/// Column (UTF-16 units) of `byte_pos` on line `row`, given `line_starts`.
99pub fn col16(src: &str, starts: &[usize], row: usize, byte_pos: usize) -> u32 {

Callers 15

create_nodeMethod · 0.85
create_nodeMethod · 0.85
create_nodeMethod · 0.85
create_nodeMethod · 0.85
create_nodeMethod · 0.85
create_nodeMethod · 0.85
col16Function · 0.85
init_signatureFunction · 0.85
create_nodeMethod · 0.85
create_nodeMethod · 0.85
visitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected