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

Method clearCaches

src/resolution/index.ts:388–411  ·  view source on GitHub ↗

* Clear internal caches

()

Source from the content-addressed store, hash-verified

386 * Clear internal caches
387 */
388 clearCaches(): void {
389 this.nodeCache.clear();
390 this.fileCache.clear();
391 this.importMappingCache.clear();
392 this.reExportCache.clear();
393 this.nameCache.clear();
394 this.lowerNameCache.clear();
395 this.qualifiedNameCache.clear();
396 this.fileLinesCache.clear();
397 this.methodMatchCache.clear();
398 this.methodOwnerIndexCache.clear();
399 this.supertypeMemo.clear();
400 this.supertypeGen++;
401 this.nodesByKindCache.clear();
402 this.knownNames = null;
403 this.knownFiles = null;
404 this.cachesWarmed = false;
405 // The import-resolver's and name-matcher's per-context memos assume the
406 // same stable window as the caches above — drop them together.
407 if (this.context) {
408 clearImportResolverMemos(this.context);
409 clearNameMatcherMemos(this.context);
410 }
411 }
412
413 /** `readFile` through the LRU content cache (null = read failed, also cached). */
414 private readFileCached(filePath: string): string | null {

Callers 6

initializeMethod · 0.95
runPostExtractMethod · 0.95
syncMethod · 0.80
resolution.test.tsFile · 0.80

Calls 3

clearImportResolverMemosFunction · 0.90
clearNameMatcherMemosFunction · 0.90
clearMethod · 0.45

Tested by

no test coverage detected