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)
| 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. |
| 184 | pub 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 | /// |