extractInstantiation's composite_literal branch: named struct types only; the package qualifier is KEPT.
(&mut self, node: Node<'t>)
| 945 | /// extractInstantiation's composite_literal branch: named struct types |
| 946 | /// only; the package qualifier is KEPT. |
| 947 | fn extract_instantiation(&mut self, node: Node<'t>) { |
| 948 | if self.stack.is_empty() { |
| 949 | return; |
| 950 | } |
| 951 | let ctor = node |
| 952 | .child_by_field_name("constructor") |
| 953 | .or_else(|| node.child_by_field_name("type")) |
| 954 | .or_else(|| node.child_by_field_name("name")) |
| 955 | .or_else(|| node.named_child(0)); |
| 956 | let Some(ctor) = ctor else { return }; |
| 957 | if !matches!(ctor.kind(), "type_identifier" | "qualified_type") { |
| 958 | return; |
| 959 | } |
| 960 | let mut go_type = self.text(ctor).trim().to_string(); |
| 961 | if let Some(br) = go_type.find('[') { |
| 962 | if br > 0 { |
| 963 | go_type.truncate(br); |
| 964 | go_type = go_type.trim().to_string(); |
| 965 | } |
| 966 | } |
| 967 | if !go_type.is_empty() { |
| 968 | let from = self.top_row(); |
| 969 | self.push_ref_at(from, &go_type, edge_kind_index("instantiates").unwrap(), node); |
| 970 | } |
| 971 | } |
| 972 | |
| 973 | /// goEmbeddedTypeName (languages/go.ts): the name node of the type an |
| 974 | /// embedding names — `T`, `*T` (the `*` is a sibling token), `pkg.T` and |
no test coverage detected