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

Method initialize

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

515 * project with none of it), and each worker doing that again added up.
516 */
517 initialize(frameworks?: readonly string[]): void {
518 // A full index resolves by the package.json files on disk now, as the
519 // fingerprint it stamps says, even in a process that read them earlier.
520 this.workspacePackages = undefined;
521 this.workspaceDiscovery = null;
522 this.cargoCrates = undefined;
523 this.compileDbIncludeDirs = undefined;
524 this.layoutIncludeDirs = undefined;
525 // Detection reads through the caches (file contents, existence probes,
526 // declared dependencies): clear them first, or a process that read the
527 // manifests earlier detects by what they said then (#2519).
528 this.clearCaches();
529 this.frameworks = frameworks
530 ? getAllFrameworkResolvers().filter((f) => frameworks.includes(f.name))
531 : detectFrameworks(this.context);
532 this.frameworksByLanguage.clear();
533 }
534
535 /** The detected frameworks whose `resolve()` reads a reference written in `language`. */
536 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