The files with a resolution edge into one of `targetIds`.
(targetIds: string[])
| 4095 | |
| 4096 | /** The files with a resolution edge into one of `targetIds`. */ |
| 4097 | getFilesWithEdgesInto(targetIds: string[]): string[] { |
| 4098 | const files = new Set<string>(); |
| 4099 | for (let i = 0; i < targetIds.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 4100 | const chunk = targetIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 4101 | const placeholders = chunk.map(() => '?').join(','); |
| 4102 | const rows = this.db |
| 4103 | .prepare( |
| 4104 | `SELECT DISTINCT src.file_path AS file_path |
| 4105 | FROM edges e |
| 4106 | JOIN nodes src ON src.id = e.source |
| 4107 | WHERE e.target IN (${placeholders}) |
| 4108 | AND e.kind != 'contains' |
| 4109 | AND (e.provenance IS NULL OR e.provenance != 'heuristic')` |
| 4110 | ) |
| 4111 | .all(...chunk) as Array<{ file_path: string }>; |
| 4112 | for (const row of rows) files.add(row.file_path); |
| 4113 | } |
| 4114 | return [...files]; |
| 4115 | } |
| 4116 | |
| 4117 | /** The import nodes named one of `names` (an import node is named by the module path it imports). */ |
| 4118 | getImportNodesByNames(names: string[]): Array<{ filePath: string; name: string; language: Language }> { |