(&mut self, node: Node<'t>)
| 985 | // --- extractors ------------------------------------------------------------------ |
| 986 | |
| 987 | fn extract_function(&mut self, node: Node<'t>) { |
| 988 | stack_guard!(); |
| 989 | // getReceiverType short-circuit (1522) — extension fns at any scope. |
| 990 | if self.receiver_type_of(node).is_some() { |
| 991 | self.extract_method(node); |
| 992 | return; |
| 993 | } |
| 994 | let name = self.extract_name(node); |
| 995 | if name == "<anonymous>" { |
| 996 | if let Some(body) = self.resolve_body(node) { |
| 997 | self.visit_function_body(body); |
| 998 | } |
| 999 | return; |
| 1000 | } |
| 1001 | let extra = Extra { |
| 1002 | docstring: preceding_docstring(node, self.src), |
| 1003 | signature: self.signature_of(node), |
| 1004 | visibility: Some(self.visibility_of(node)), |
| 1005 | is_async: Some(self.is_async(node)), |
| 1006 | is_static: Some(false), // kotlin isStatic is always false |
| 1007 | return_type: self.return_type_of(node), |
| 1008 | ..Extra::default() |
| 1009 | }; |
| 1010 | let Some(row) = self.create_node("function", &name, node, extra) else { return }; |
| 1011 | // extractTypeAnnotations: the generic path's field lookups all miss |
| 1012 | // (zero fields) — kotlin emits ZERO type-annotation refs. |
| 1013 | self.extract_decorators_for(node, row); |
| 1014 | self.stack.push(Scope { row, kind: "function", name }); |
| 1015 | if let Some(body) = self.resolve_body(node) { |
| 1016 | self.visit_function_body(body); |
| 1017 | } |
| 1018 | self.stack.pop(); |
| 1019 | } |
| 1020 | |
| 1021 | fn extract_method(&mut self, node: Node<'t>) { |
| 1022 | stack_guard!(); |
no test coverage detected