(callee: string)
| 548 | // nothing, so it does not count. |
| 549 | const projectTypes = new Map<string, boolean>(); |
| 550 | const declaresSwiftType = async (callee: string): Promise<boolean> => { |
| 551 | const root = callee.replace(/^(?:self|Self)\./, '').split(/[.(:<]/)[0] ?? ''; |
| 552 | if (!/^[A-Z]\w*$/.test(root)) return false; |
| 553 | let known = projectTypes.get(root); |
| 554 | if (known === undefined) { |
| 555 | known = false; |
| 556 | for (const n of cg.getNodesByName(root)) { |
| 557 | if (n.language !== 'swift' || !['class', 'struct', 'enum', 'interface', 'protocol'].includes(n.kind)) continue; |
| 558 | if (!(await reader.swiftExtension(n))) { |
| 559 | known = true; |
| 560 | break; |
| 561 | } |
| 562 | } |
| 563 | projectTypes.set(root, known); |
| 564 | } |
| 565 | return known; |
| 566 | }; |
| 567 | const resolveByReceiver = async (caller: Node, callee: string): Promise<Node | null> => { |
| 568 | const segments = callee.replace(/\([^()]*\)/g, '').split(/[.:]+/).filter(Boolean); |
| 569 | if (segments.length < 2) return null; |
no test coverage detected