The files with a resolution edge into one of `targetIds`.
(targetIds: string[])
| 3984 | |
| 3985 | /** The files with a resolution edge into one of `targetIds`. */ |
| 3986 | getFilesWithEdgesInto(targetIds: string[]): string[] { |
| 3987 | const files = new Set<string>(); |
| 3988 | for (let i = 0; i < targetIds.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 3989 | const chunk = targetIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 3990 | const placeholders = chunk.map(() => '?').join(','); |
| 3991 | const rows = this.db |
| 3992 | .prepare( |
| 3993 | `SELECT DISTINCT src.file_path AS file_path |
| 3994 | FROM edges e |
| 3995 | JOIN nodes src ON src.id = e.source |
| 3996 | WHERE e.target IN (${placeholders}) |
| 3997 | AND e.kind != 'contains' |
| 3998 | AND (e.provenance IS NULL OR e.provenance != 'heuristic')` |
| 3999 | ) |
| 4000 | .all(...chunk) as Array<{ file_path: string }>; |
| 4001 | for (const row of rows) files.add(row.file_path); |
| 4002 | } |
| 4003 | return [...files]; |
| 4004 | } |
| 4005 | |
| 4006 | /** The import nodes named one of `names` (an import node is named by the module path it imports). */ |
| 4007 | getImportNodesByNames(names: string[]): Array<{ filePath: string; name: string; language: Language }> { |