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