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