| 846 | } |
| 847 | |
| 848 | fn classify_ts_class_member(node: Node) -> Member { |
| 849 | if !matches!(node.kind(), "public_field_definition" | "field_definition") { |
| 850 | return Member::Method; |
| 851 | } |
| 852 | for i in 0..node.named_child_count() { |
| 853 | let Some(child) = node.named_child(i) else { continue }; |
| 854 | if matches!(child.kind(), "arrow_function" | "function_expression") { |
| 855 | return Member::Method; |
| 856 | } |
| 857 | if child.kind() == "call_expression" { |
| 858 | if let Some(args) = child.child_by_field_name("arguments") { |
| 859 | for j in 0..args.named_child_count() { |
| 860 | if let Some(arg) = args.named_child(j) { |
| 861 | if matches!(arg.kind(), "arrow_function" | "function_expression") { |
| 862 | return Member::Method; |
| 863 | } |
| 864 | } |
| 865 | } |
| 866 | } |
| 867 | } |
| 868 | } |
| 869 | Member::Property |
| 870 | } |
| 871 | |
| 872 | /// typescriptExtractor.resolveBody / javascriptExtractor.resolveBody: the body |
| 873 | /// of a function-valued class field, nested in the arrow / HOF-wrapped arrow. |