MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / class_expression_head

Function class_expression_head

codegraph-kernel/src/tsjs/extractors.rs:2111–2115  ·  view source on GitHub ↗

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<'_>)

Source from the content-addressed store, hash-verified

2109/// body, trailing spaces and line breaks dropped. Mirrors classExpressionHead
2110/// (tree-sitter.ts).
2111fn class_expression_head(src: &str, node: Node<'_>, body: Node<'_>) -> String {
2112 src[node.start_byte()..body.start_byte()]
2113 .trim_end_matches(|c: char| matches!(c, ' ' | '\t' | '\r' | '\n'))
2114 .to_string()
2115}
2116
2117/// `.replace(/\s+/g, ' ')` for the tuple-contract signature.
2118fn collapse_ws(s: &str) -> String {

Callers 1

extract_classMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected