MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extract_go_interface_methods

Method extract_go_interface_methods

codegraph-kernel/src/go.rs:589–605  ·  view source on GitHub ↗

extractGoInterfaceMethods: method_elem/method_spec → method nodes.

(&mut self, interface_type: Node<'t>, iface_row: u32, iface_name: &str)

Source from the content-addressed store, hash-verified

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>) {

Callers 1

extract_type_aliasMethod · 0.80

Calls 3

textMethod · 0.45
signature_ofMethod · 0.45
create_nodeMethod · 0.45

Tested by

no test coverage detected