* Find first named child whose type is in the given list. * Used to locate inner type nodes (e.g. enum_specifier inside a typedef).
(node: SyntaxNode, types: string[])
| 1387 | * Used to locate inner type nodes (e.g. enum_specifier inside a typedef). |
| 1388 | */ |
| 1389 | private findChildByTypes(node: SyntaxNode, types: string[]): SyntaxNode | null { |
| 1390 | for (let i = 0; i < node.namedChildCount; i++) { |
| 1391 | const child = node.namedChild(i); |
| 1392 | if (child && types.includes(child.type)) return child; |
| 1393 | } |
| 1394 | return null; |
| 1395 | } |
| 1396 | |
| 1397 | /** |
| 1398 | * Find a `packageTypes` child under the root, create a `namespace` node |