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

Function utf16_len

codegraph-kernel/src/textutil.rs:184–186  ·  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

182/// UTF-16 code units in `s` — what web-tree-sitter (and JS string ops)
183/// count, so kernel-emitted columns are byte-identical to the wasm path's.
184pub fn utf16_len(s: &str) -> usize {
185 s.chars().map(|c| c.len_utf16()).sum()
186}
187
188/// Column (UTF-16 units) of `byte_pos` on line `row`, given `line_starts`.
189///

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
init_signatureFunction · 0.85
create_nodeMethod · 0.85
create_nodeMethod · 0.85
visitMethod · 0.85

Calls 1

mapMethod · 0.80

Tested by 1