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

Function is_class_node

codegraph-kernel/src/tsjs/mod.rs:92–95  ·  view source on GitHub ↗

Whether `node` is a class to extract: a class declaration, or a class expression (`class`) with a name, `register(class Widget extends Base {…})` (#2499); an anonymous one is passed over. Mirrors TreeSitterExtractor.isClassTypeNode.

(v: Variant, node: Node)

Source from the content-addressed store, hash-verified

90/// {…})` (#2499); an anonymous one is passed over. Mirrors
91/// TreeSitterExtractor.isClassTypeNode.
92fn is_class_node(v: Variant, node: Node) -> bool {
93 let kind = node.kind();
94 is_class_type(v, kind) && (kind != "class" || node.child_by_field_name("name").is_some())
95}
96
97fn is_variable_type(kind: &str) -> bool {
98 matches!(kind, "lexical_declaration" | "variable_declaration")

Callers 2

visit_nodeMethod · 0.85

Calls 1

is_class_typeFunction · 0.70

Tested by

no test coverage detected