extractMethod (1737) — method_declaration + constructor_declaration. Signature is ALWAYS undefined (no getSignature hook); isAsync is real.
(&mut self, node: Node<'t>)
| 1011 | /// extractMethod (1737) — method_declaration + constructor_declaration. |
| 1012 | /// Signature is ALWAYS undefined (no getSignature hook); isAsync is real. |
| 1013 | fn extract_method(&mut self, node: Node<'t>) { |
| 1014 | stack_guard!(); |
| 1015 | if !self.inside_class_like() { |
| 1016 | // Unreachable on non-erroring C# (top-level `void M(){}` parses as |
| 1017 | // local_function_statement; erroring files defer) — mirror the TS |
| 1018 | // treat-as-function tail for shape. |
| 1019 | self.extract_function(node); |
| 1020 | return; |
| 1021 | } |
| 1022 | let name = self.extract_name(node); |
| 1023 | let extra = Extra { |
| 1024 | docstring: preceding_docstring(node, self.src), |
| 1025 | signature: None, |
| 1026 | visibility: Some(self.visibility_of(node)), |
| 1027 | is_async: Some(self.is_async(node)), |
| 1028 | is_static: Some(self.is_static(node)), |
| 1029 | return_type: self.return_type_of(node), |
| 1030 | }; |
| 1031 | let Some(row) = self.create_node("method", &name, node, extra) else { return }; |
| 1032 | // extractTypeAnnotations short-circuits into the csharp path: |
| 1033 | // `returns`-field refs FIRST, then per-parameter type refs. |
| 1034 | self.extract_csharp_type_refs(node, row); |
| 1035 | // decorators: none. |
| 1036 | self.stack.push(Scope { row, kind: "method", name }); |
| 1037 | // The `body` FIELD only (block or arrow_expression_clause). A |
| 1038 | // constructor_initializer (`: base(args)`) is NOT the body → its |
| 1039 | // argument calls are LOST (quirk, preserve). |
| 1040 | if let Some(body) = node.child_by_field_name("body") { |
| 1041 | self.visit_function_body(body); |
| 1042 | } |
| 1043 | self.stack.pop(); |
| 1044 | } |
| 1045 | |
| 1046 | /// extractFunction — only reachable for a method outside any class |
| 1047 | /// (unreachable on non-erroring C#; kept faithful to the generic tail). |
no test coverage detected