A class expression's head, `class Widget extends Base`: its text up to the body, trailing spaces and line breaks dropped. Mirrors classExpressionHead (tree-sitter.ts).
(src: &str, node: Node<'_>, body: Node<'_>)
| 2247 | /// body, trailing spaces and line breaks dropped. Mirrors classExpressionHead |
| 2248 | /// (tree-sitter.ts). |
| 2249 | fn class_expression_head(src: &str, node: Node<'_>, body: Node<'_>) -> String { |
| 2250 | src[node.start_byte()..body.start_byte()] |
| 2251 | .trim_end_matches(|c: char| matches!(c, ' ' | '\t' | '\r' | '\n')) |
| 2252 | .to_string() |
| 2253 | } |
| 2254 | |
| 2255 | /// `.replace(/\s+/g, ' ')` for the tuple-contract signature. |
| 2256 | fn collapse_ws(s: &str) -> String { |