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

Method constructor

src/resolution/index.ts:283–304  ·  view source on GitHub ↗
(projectRoot: string, queries: QueryBuilder)

Source from the content-addressed store, hash-verified

281 private workspacePackages: WorkspacePackages | null | undefined = undefined;
282
283 constructor(projectRoot: string, queries: QueryBuilder) {
284 this.projectRoot = projectRoot;
285 this.queries = queries;
286
287 const limit = resolveCacheLimit();
288 // The content cache is heavier (full file text), so we give it a
289 // smaller budget than the metadata caches.
290 const contentLimit = Math.max(64, Math.floor(limit / 5));
291 this.nodeCache = new LRUCache(limit);
292 this.fileCache = new LRUCache(contentLimit);
293 this.importMappingCache = new LRUCache(limit);
294 this.reExportCache = new LRUCache(limit);
295 this.nameCache = new LRUCache(limit);
296 this.lowerNameCache = new LRUCache(limit);
297 this.qualifiedNameCache = new LRUCache(limit);
298 // Split-lines arrays are heavier than content strings; refs arrive
299 // file-ordered, so a small cache still hits nearly always.
300 this.fileLinesCache = new LRUCache(contentLimit);
301 this.methodMatchCache = new LRUCache(limit);
302
303 this.context = this.createContext();
304 }
305
306 /**
307 * Initialize the resolver (detect frameworks, etc.)

Callers

nothing calls this directly

Calls 2

createContextMethod · 0.95
resolveCacheLimitFunction · 0.85

Tested by

no test coverage detected