extractFunction — only reachable for a method outside any class (unreachable on non-erroring C#; kept faithful to the generic tail).
(&mut self, node: Node<'t>)
| 1037 | /// extractFunction — only reachable for a method outside any class |
| 1038 | /// (unreachable on non-erroring C#; kept faithful to the generic tail). |
| 1039 | fn extract_function(&mut self, node: Node<'t>) { |
| 1040 | stack_guard!(); |
| 1041 | let name = self.extract_name(node); |
| 1042 | if name == "<anonymous>" { |
| 1043 | if let Some(body) = node.child_by_field_name("body") { |
| 1044 | self.visit_function_body(body); |
| 1045 | } |
| 1046 | return; |
| 1047 | } |
| 1048 | let extra = Extra { |
| 1049 | docstring: preceding_docstring(node, self.src), |
| 1050 | signature: None, |
| 1051 | visibility: Some(self.visibility_of(node)), |
| 1052 | is_async: Some(self.is_async(node)), |
| 1053 | is_static: Some(self.is_static(node)), |
| 1054 | return_type: self.return_type_of(node), |
| 1055 | }; |
| 1056 | let Some(row) = self.create_node("function", &name, node, extra) else { return }; |
| 1057 | self.extract_csharp_type_refs(node, row); |
| 1058 | self.stack.push(Scope { row, kind: "function", name }); |
| 1059 | if let Some(body) = node.child_by_field_name("body") { |
| 1060 | self.visit_function_body(body); |
| 1061 | } |
| 1062 | self.stack.pop(); |
| 1063 | } |
| 1064 | |
| 1065 | fn extract_variable(&mut self, node: Node<'t>) { |
| 1066 | // extractVariable's generic fallback: direct identifier / |
no test coverage detected