The `= [...]` initializer signature (tree-sitter-helpers.ts initSignature): `...` when the initializer is a hundred units or longer. That is every cut, and the one that stops a unit short of the hundred so as not to split a surrogate pair is still a cut.
(value_text: &str)
| 245 | /// hundred units or longer. That is every cut, and the one that stops a unit |
| 246 | /// short of the hundred so as not to split a surrogate pair is still a cut. |
| 247 | pub fn init_signature(value_text: &str) -> String { |
| 248 | let (sliced, truncated) = slice_utf16(value_text, 100); |
| 249 | if truncated || utf16_len(&sliced) >= 100 { |
| 250 | format!("= {sliced}...") |
| 251 | } else { |
| 252 | format!("= {sliced}") |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | #[cfg(test)] |
| 257 | mod tests { |