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

Method getModuleConfigSnapshot

src/resolution/index.ts:3334–3345  ·  view source on GitHub ↗

* The module-config files the index was resolved by, with a digest of each * (see `moduleConfigSnapshot`): every tsconfig / jsconfig this resolver read * (`extends` chains included), every go.mod, and the root's candidates * whether present or not, so one that appears is seen too. `previous

(previous: string | null, treeMoved = false)

Source from the content-addressed store, hash-verified

3332 * snapshot from before manifests counted has its members to learn too.
3333 */
3334 getModuleConfigSnapshot(previous: string | null, treeMoved = false): ModuleConfigSnapshot {
3335 const was = parseModuleConfigSnapshot(previous);
3336 if (treeMoved || !('Cargo.toml' in was)) {
3337 this.cargoCrates = undefined;
3338 this.layoutIncludeDirs = undefined;
3339 this.readCargoCrates();
3340 }
3341 const files = new Set<string>(this.moduleConfigFiles);
3342 for (const name of MODULE_CONFIG_ROOT_FILES) files.add(path.join(this.projectRoot, name));
3343 for (const rel of Object.keys(was)) files.add(path.join(this.projectRoot, rel));
3344 return moduleConfigSnapshot(this.projectRoot, files, was);
3345 }
3346
3347 /** The Cargo workspace's crates, read from disk the first time; every member's manifest joins the snapshot. */
3348 private readCargoCrates(): Map<string, string> {

Callers 3

syncMethod · 0.80

Calls 5

readCargoCratesMethod · 0.95
moduleConfigSnapshotFunction · 0.85
addMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected