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

Function loadParsedConfig

src/project-config.ts:314–332  ·  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

312 * read/parse) while a single config file is in force, shared across every field.
313 */
314function loadParsedConfig(rootDir: string): ParsedConfig {
315 const file = path.join(rootDir, PROJECT_CONFIG_FILENAME);
316
317 let mtimeMs: number;
318 try {
319 mtimeMs = fs.statSync(file).mtimeMs;
320 } catch {
321 // No config file — drop any stale cache entry and return the default.
322 cache.delete(rootDir);
323 return EMPTY_CONFIG;
324 }
325
326 const entry = cache.get(rootDir);
327 if (entry && entry.mtimeMs === mtimeMs) return entry.config;
328
329 const config = parseConfig(file);
330 cache.set(rootDir, { mtimeMs, config });
331 return config;
332}
333
334/**
335 * Load the validated extension overrides for a project, mtime-cached.

Callers 5

loadExtensionOverridesFunction · 0.85
loadExcludePatternsFunction · 0.85
loadDeprioritizePatternsFunction · 0.85
loadIncludePatternsFunction · 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