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

Function classify_ts_class_member

codegraph-kernel/src/tsjs/mod.rs:1121–1140  ·  view source on GitHub ↗
(node: Node)

Source from the content-addressed store, hash-verified

1119}
1120
1121fn classify_ts_class_member(node: Node) -> Member {
1122 if !matches!(node.kind(), "public_field_definition" | "field_definition") {
1123 return Member::Method;
1124 }
1125 for child in node.named_children(&mut node.walk()) {
1126 if matches!(child.kind(), "arrow_function" | "function_expression") {
1127 return Member::Method;
1128 }
1129 if child.kind() == "call_expression" {
1130 if let Some(args) = child.child_by_field_name("arguments") {
1131 for arg in args.named_children(&mut args.walk()) {
1132 if matches!(arg.kind(), "arrow_function" | "function_expression") {
1133 return Member::Method;
1134 }
1135 }
1136 }
1137 }
1138 }
1139 Member::Property
1140}
1141
1142/// typescriptExtractor.resolveBody / javascriptExtractor.resolveBody: the body
1143/// of a function-valued class field, nested in the arrow / HOF-wrapped arrow.

Callers 1

visit_nodeMethod · 0.85

Calls 1

walkMethod · 0.45

Tested by

no test coverage detected