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

Method refreshWorkspacePackages

src/resolution/index.ts:3453–3465  ·  view source on GitHub ↗

* The workspace packages and path dependencies as package.json files * declare them now, read again from disk, and their fingerprint (see * `workspaceFingerprint`). The resolver keeps the map for its lifetime, so * a sync calls this to see a manifest edit; when the map moved, the * resol

(knownManifests?: readonly string[])

Source from the content-addressed store, hash-verified

3451 * one, and the caller re-opens what was linked by it.
3452 */
3453 refreshWorkspacePackages(knownManifests?: readonly string[]): string {
3454 // `knownManifests`: where the manifests are, when the caller can tell that
3455 // a walk would find the ones it found last time (see trustedManifestList).
3456 // Each is read again all the same, so an edit to one is seen.
3457 const { packages: fresh, discovery } = loadWorkspacePackagesAndManifests(this.projectRoot, knownManifests);
3458 if (discovery) this.workspaceDiscovery = discovery;
3459 const fingerprint = workspaceFingerprint(fresh);
3460 if (this.workspacePackages === undefined || workspaceFingerprint(this.workspacePackages) !== fingerprint) {
3461 this.workspacePackages = fresh;
3462 this.clearCaches();
3463 }
3464 return fingerprint;
3465 }
3466
3467 /** The walk the workspace map was last read by (see ManifestDiscovery), or null before any. */
3468 getWorkspaceDiscovery(): ManifestDiscovery | null {

Callers 1

syncMethod · 0.80

Calls 3

clearCachesMethod · 0.95
workspaceFingerprintFunction · 0.90

Tested by

no test coverage detected