MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / reopenModuleEdges

Function reopenModuleEdges

src/resolution/module-importers.ts:657–668  ·  view source on GitHub ↗

Swap the outranked module edges for their references, for the sweep. Returns how many.

(queries: QueryBuilder, outranked: readonly OutrankedImport[])

Source from the content-addressed store, hash-verified

655
656/** Swap the outranked module edges for their references, for the sweep. Returns how many. */
657function reopenModuleEdges(queries: QueryBuilder, outranked: readonly OutrankedImport[]): number {
658 const edgeIds: number[] = [];
659 const refs: UnresolvedReference[] = [];
660 for (const { edge } of outranked) {
661 const ref = resurrectRefFromDroppedEdge(edge);
662 if (!ref || edgeIds.includes(edge.edgeId)) continue;
663 edgeIds.push(edge.edgeId);
664 refs.push(ref);
665 }
666 if (refs.length > 0) queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs);
667 return refs.length;
668}
669
670/**
671 * The files with an import statement naming one of `files`, or one of the

Callers 1

Calls 3

pushMethod · 0.80

Tested by

no test coverage detected