extractGoInterfaceMethods: method_elem/method_spec → method nodes.
(&mut self, interface_type: Node<'t>, iface_row: u32, iface_name: &str)
| 587 | |
| 588 | /// extractGoInterfaceMethods: method_elem/method_spec → method nodes. |
| 589 | fn extract_go_interface_methods(&mut self, interface_type: Node<'t>, iface_row: u32, iface_name: &str) { |
| 590 | self.stack.push(Scope { row: iface_row, kind: "interface", name: iface_name.to_string() }); |
| 591 | for i in 0..interface_type.named_child_count() { |
| 592 | let Some(m) = interface_type.named_child(i) else { continue }; |
| 593 | if !matches!(m.kind(), "method_elem" | "method_spec") { |
| 594 | continue; |
| 595 | } |
| 596 | let name_node = m.child_by_field_name("name").or_else(|| m.named_child(0)); |
| 597 | let Some(name_node) = name_node else { continue }; |
| 598 | let mname = self.text(name_node).to_string(); |
| 599 | if !mname.is_empty() { |
| 600 | let signature = self.signature_of(m); |
| 601 | self.create_node("method", &mname, m, Extra { signature, ..Extra::default() }); |
| 602 | } |
| 603 | } |
| 604 | self.stack.pop(); |
| 605 | } |
| 606 | |
| 607 | /// extractVariable's Go branch: var/const specs + short_var_declaration. |
| 608 | fn extract_variable(&mut self, node: Node<'t>) { |
no test coverage detected