extractMethod (1737) — method_declaration + constructor_declaration. Signature is ALWAYS undefined (no getSignature hook); isAsync is real.
(&mut self, node: Node<'t>)
| 890 | /// extractMethod (1737) — method_declaration + constructor_declaration. |
| 891 | /// Signature is ALWAYS undefined (no getSignature hook); isAsync is real. |
| 892 | fn extract_method(&mut self, node: Node<'t>) { |
| 893 | if !self.inside_class_like() { |
| 894 | // Unreachable on non-erroring C# (top-level `void M(){}` parses as |
| 895 | // local_function_statement; erroring files defer) — mirror the TS |
| 896 | // treat-as-function tail for shape. |
| 897 | self.extract_function(node); |
| 898 | return; |
| 899 | } |
| 900 | let name = self.extract_name(node); |
| 901 | let extra = Extra { |
| 902 | docstring: preceding_docstring(node, self.src), |
| 903 | signature: None, |
| 904 | visibility: Some(self.visibility_of(node)), |
| 905 | is_async: Some(self.is_async(node)), |
| 906 | is_static: Some(self.is_static(node)), |
| 907 | return_type: self.return_type_of(node), |
| 908 | }; |
| 909 | let Some(row) = self.create_node("method", &name, node, extra) else { return }; |
| 910 | // extractTypeAnnotations short-circuits into the csharp path: |
| 911 | // `returns`-field refs FIRST, then per-parameter type refs. |
| 912 | self.extract_csharp_type_refs(node, row); |
| 913 | // decorators: none. |
| 914 | self.stack.push(Scope { row, kind: "method", name }); |
| 915 | // The `body` FIELD only (block or arrow_expression_clause). A |
| 916 | // constructor_initializer (`: base(args)`) is NOT the body → its |
| 917 | // argument calls are LOST (quirk, preserve). |
| 918 | if let Some(body) = node.child_by_field_name("body") { |
| 919 | self.visit_function_body(body); |
| 920 | } |
| 921 | self.stack.pop(); |
| 922 | } |
| 923 | |
| 924 | /// extractFunction — only reachable for a method outside any class |
| 925 | /// (unreachable on non-erroring C#; kept faithful to the generic tail). |
no test coverage detected