extractInstantiation's composite_literal branch: named struct types only; the package qualifier is KEPT.
(&mut self, node: Node<'t>)
| 813 | /// extractInstantiation's composite_literal branch: named struct types |
| 814 | /// only; the package qualifier is KEPT. |
| 815 | fn extract_instantiation(&mut self, node: Node<'t>) { |
| 816 | if self.stack.is_empty() { |
| 817 | return; |
| 818 | } |
| 819 | let ctor = node |
| 820 | .child_by_field_name("constructor") |
| 821 | .or_else(|| node.child_by_field_name("type")) |
| 822 | .or_else(|| node.child_by_field_name("name")) |
| 823 | .or_else(|| node.named_child(0)); |
| 824 | let Some(ctor) = ctor else { return }; |
| 825 | if !matches!(ctor.kind(), "type_identifier" | "qualified_type") { |
| 826 | return; |
| 827 | } |
| 828 | let mut go_type = self.text(ctor).trim().to_string(); |
| 829 | if let Some(br) = go_type.find('[') { |
| 830 | if br > 0 { |
| 831 | go_type.truncate(br); |
| 832 | go_type = go_type.trim().to_string(); |
| 833 | } |
| 834 | } |
| 835 | if !go_type.is_empty() { |
| 836 | let from = self.top_row(); |
| 837 | self.push_ref_at(from, &go_type, edge_kind_index("instantiates").unwrap(), node); |
| 838 | } |
| 839 | } |
| 840 | |
| 841 | /// extractInheritance — the Go branches: interface embedding |
| 842 | /// (constraint_elem) and struct embedding (field_declaration without a |
no test coverage detected