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

Method reopenRouteModuleReaders

src/resolution/index.ts:644–661  ·  view source on GitHub ↗

* Put back in the pending set the route references whose answer reads a * module in `changedFilePaths` (`FrameworkResolver.lazyModules`), for a * sync's resolution sweep. Returns the number put back. * * A route that renders a same-file `const Docs = lazy(() => * import('./pages/Docs'

(changedFilePaths: readonly string[])

Source from the content-addressed store, hash-verified

642 * new files already.
643 */
644 reopenRouteModuleReaders(changedFilePaths: readonly string[]): number {
645 const readers = this.frameworks.filter((f) => f.lazyModules);
646 if (readers.length === 0 || changedFilePaths.length === 0) return 0;
647 const changed = new Set(changedFilePaths);
648 const edgeIds: number[] = [];
649 const refs: UnresolvedReference[] = [];
650 for (const edge of this.queries.getRouteEdgesMovedBy(changedFilePaths)) {
651 const ref = resurrectRefFromDroppedEdge(edge);
652 if (!ref) continue;
653 const asked: UnresolvedRef = { ...ref, filePath: edge.sourceFilePath, language: edge.sourceLanguage };
654 const reads = readers.some((f) => f.lazyModules!(asked, this.context).some((file) => changed.has(file)));
655 if (!reads) continue;
656 edgeIds.push(edge.edgeId);
657 refs.push(ref);
658 }
659 if (refs.length > 0) this.queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs);
660 return refs.length;
661 }
662
663 /**
664 * Pre-build lightweight caches for resolution.

Callers 1

syncMethod · 0.80

Calls 5

getRouteEdgesMovedByMethod · 0.80
hasMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected