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

Method extract_go_interface_methods

codegraph-kernel/src/go.rs:594–610  ·  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

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

Callers 1

extract_type_aliasMethod · 0.80

Calls 3

textMethod · 0.65
signature_ofMethod · 0.45
create_nodeMethod · 0.45

Tested by

no test coverage detected