* Cross-file edges whose TARGET is a node in `filePath` and whose SOURCE is a * node in a *different* file, paired with the target node's (name, kind). * Node IDs are `sha256(filePath:kind:name:line)`, so any line shift in the * callee file changes target IDs and a naive re-insert by old ID
(
filePath: string
)
| 3689 | * `contains`. |
| 3690 | */ |
| 3691 | getCrossFileIncomingEdgesWithTarget( |
| 3692 | filePath: string |
| 3693 | ): Array<Edge & { edgeId: number; targetName: string; targetKind: NodeKind; sourceFilePath: string; sourceLanguage: Language }> { |
| 3694 | const sql = `SELECT e.*, tgt.name AS target_name, tgt.kind AS target_kind, |
| 3695 | src.file_path AS source_file_path, src.language AS source_language |
| 3696 | FROM edges e |
| 3697 | JOIN nodes tgt ON tgt.id = e.target |
| 3698 | JOIN nodes src ON src.id = e.source |
| 3699 | WHERE tgt.file_path = ? |
| 3700 | AND e.kind != 'contains' |
| 3701 | AND src.file_path != ?`; |
| 3702 | const rows = this.db.prepare(sql).all(filePath, filePath) as Array< |
| 3703 | EdgeRow & { target_name: string; target_kind: NodeKind; source_file_path: string; source_language: Language } |
| 3704 | >; |
| 3705 | return rows.map(row => ({ |
| 3706 | ...rowToEdge(row), |
| 3707 | edgeId: row.id, |
| 3708 | targetName: row.target_name, |
| 3709 | targetKind: row.target_kind, |
| 3710 | sourceFilePath: row.source_file_path, |
| 3711 | sourceLanguage: row.source_language, |
| 3712 | })); |
| 3713 | } |
| 3714 | |
| 3715 | /** |
| 3716 | * Resolution edges out of the nodes of `filePath` whose reference was |
no test coverage detected