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)
| 144 | /// UTF-16 code units in `s` — what web-tree-sitter (and JS string ops) |
| 145 | /// count, so kernel-emitted columns are byte-identical to the wasm path's. |
| 146 | pub fn utf16_len(s: &str) -> usize { |
| 147 | s.chars().map(|c| c.len_utf16()).sum() |
| 148 | } |
| 149 | |
| 150 | /// Column (UTF-16 units) of `byte_pos` on line `row`, given `line_starts`. |
| 151 | pub fn col16(src: &str, starts: &[usize], row: usize, byte_pos: usize) -> u32 { |
no test coverage detected