* 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[])
| 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[] { |