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

Function reopenModuleEdges

src/resolution/module-importers.ts:542–553  ·  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

540
541/** Swap the outranked module edges for their references, for the sweep. Returns how many. */
542function reopenModuleEdges(queries: QueryBuilder, outranked: readonly OutrankedImport[]): number {
543 const edgeIds: number[] = [];
544 const refs: UnresolvedReference[] = [];
545 for (const { edge } of outranked) {
546 const ref = resurrectRefFromDroppedEdge(edge);
547 if (!ref || edgeIds.includes(edge.edgeId)) continue;
548 edgeIds.push(edge.edgeId);
549 refs.push(ref);
550 }
551 if (refs.length > 0) queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs);
552 return refs.length;
553}
554
555/**
556 * 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