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

Function classify_ts_class_member

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

Source from the content-addressed store, hash-verified

1233}
1234
1235fn classify_ts_class_member(node: Node) -> Member {
1236 if !matches!(node.kind(), "public_field_definition" | "field_definition") {
1237 return Member::Method;
1238 }
1239 for child in node.named_children(&mut node.walk()) {
1240 if matches!(child.kind(), "arrow_function" | "function_expression") {
1241 return Member::Method;
1242 }
1243 if child.kind() == "call_expression" {
1244 if let Some(args) = child.child_by_field_name("arguments") {
1245 for arg in args.named_children(&mut args.walk()) {
1246 if matches!(arg.kind(), "arrow_function" | "function_expression") {
1247 return Member::Method;
1248 }
1249 }
1250 }
1251 }
1252 }
1253 Member::Property
1254}
1255
1256/// typescriptExtractor.resolveBody / javascriptExtractor.resolveBody: the body
1257/// 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