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

Function loadParsedConfig

src/project-config.ts:361–379  ·  view source on GitHub ↗

* Load the parsed `codegraph.json` for a project, mtime-cached. A missing or * malformed file yields the zero-config default. One `stat` (and at most one * read/parse) while a single config file is in force, shared across every field.

(rootDir: string)

Source from the content-addressed store, hash-verified

359 * read/parse) while a single config file is in force, shared across every field.
360 */
361function loadParsedConfig(rootDir: string): ParsedConfig {
362 const file = path.join(rootDir, PROJECT_CONFIG_FILENAME);
363
364 let mtimeMs: number;
365 try {
366 mtimeMs = fs.statSync(file).mtimeMs;
367 } catch {
368 // No config file — drop any stale cache entry and return the default.
369 cache.delete(rootDir);
370 return EMPTY_CONFIG;
371 }
372
373 const entry = cache.get(rootDir);
374 if (entry && entry.mtimeMs === mtimeMs) return entry.config;
375
376 const config = parseConfig(file);
377 cache.set(rootDir, { mtimeMs, config });
378 return config;
379}
380
381/**
382 * Load the validated extension overrides for a project, mtime-cached.

Callers 6

loadExtensionOverridesFunction · 0.85
loadExcludePatternsFunction · 0.85
loadDeprioritizePatternsFunction · 0.85
loadIncludePatternsFunction · 0.85
loadWebRootFunction · 0.85

Calls 5

parseConfigFunction · 0.70
deleteMethod · 0.65
getMethod · 0.65
joinMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected