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

Method refreshWorkspacePackages

src/resolution/index.ts:3303–3315  ·  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

3301 * one, and the caller re-opens what was linked by it.
3302 */
3303 refreshWorkspacePackages(knownManifests?: readonly string[]): string {
3304 // `knownManifests`: where the manifests are, when the caller can tell that
3305 // a walk would find the ones it found last time (see trustedManifestList).
3306 // Each is read again all the same, so an edit to one is seen.
3307 const { packages: fresh, discovery } = loadWorkspacePackagesAndManifests(this.projectRoot, knownManifests);
3308 if (discovery) this.workspaceDiscovery = discovery;
3309 const fingerprint = workspaceFingerprint(fresh);
3310 if (this.workspacePackages === undefined || workspaceFingerprint(this.workspacePackages) !== fingerprint) {
3311 this.workspacePackages = fresh;
3312 this.clearCaches();
3313 }
3314 return fingerprint;
3315 }
3316
3317 /** The walk the workspace map was last read by (see ManifestDiscovery), or null before any. */
3318 getWorkspaceDiscovery(): ManifestDiscovery | null {

Callers 1

syncMethod · 0.80

Calls 3

clearCachesMethod · 0.95
workspaceFingerprintFunction · 0.90

Tested by

no test coverage detected