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)
| 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. |
| 94 | pub 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`. |
| 99 | pub fn col16(src: &str, starts: &[usize], row: usize, byte_pos: usize) -> u32 { |
no outgoing calls
no test coverage detected