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

Method initialize

src/resolution/index.ts:606–622  ·  view source on GitHub ↗

* Initialize the resolver (detect frameworks, etc.). `frameworks` are the * names detection gave in the process's main thread, for a worker starting * on the same index: a detector may read every source file (Spring, in a * project with none of it), and each worker doing that again added up

(frameworks?: readonly string[])

Source from the content-addressed store, hash-verified

604 * project with none of it), and each worker doing that again added up.
605 */
606 initialize(frameworks?: readonly string[]): void {
607 // A full index resolves by the package.json files on disk now, as the
608 // fingerprint it stamps says, even in a process that read them earlier.
609 this.workspacePackages = undefined;
610 this.workspaceDiscovery = null;
611 this.cargoCrates = undefined;
612 this.compileDbIncludeDirs = undefined;
613 this.layoutIncludeDirs = undefined;
614 // Detection reads through the caches (file contents, existence probes,
615 // declared dependencies): clear them first, or a process that read the
616 // manifests earlier detects by what they said then (#2519).
617 this.clearCaches();
618 this.frameworks = frameworks
619 ? getAllFrameworkResolvers().filter((f) => frameworks.includes(f.name))
620 : detectFrameworks(this.context);
621 this.frameworksByLanguage.clear();
622 }
623
624 /** The detected frameworks whose `resolve()` reads a reference written in `language`. */
625 private frameworksFor(language: Language): FrameworkResolver[] {

Callers 4

createResolverFunction · 0.95
freshFunction · 0.95
freshFunction · 0.95
resolver-worker.tsFile · 0.45

Calls 4

clearCachesMethod · 0.95
getAllFrameworkResolversFunction · 0.90
detectFrameworksFunction · 0.90
clearMethod · 0.45

Tested by 2

freshFunction · 0.76
freshFunction · 0.76