[AA] Standalone Analysis API: Introduce KtStaticProjectStructureProvider

- `registerServicesForProjectEnvironment` relied on lists of all modules
  and source files, which the standalone project structure providers
  would have already been able to provide with the right interface.
- In `StandaloneAnalysisAPISessionBuilder.build`, to get all modules and
  source files, `projectStructureProvider` had to be hard-casted to
  `KtModuleProviderImpl`.
- This commit introduces `KtStaticProjectStructureProvider`, a shared
  interface for project structure providers with static module
  structures that know about their modules and source files.
This commit is contained in:
Marco Pennekamp
2023-05-04 21:15:44 +02:00
committed by Space Team
parent e3d803de8b
commit 7fd8e4d0fd
9 changed files with 72 additions and 41 deletions
@@ -67,8 +67,6 @@ class AnalysisApiEnvironmentManagerImpl(
StandaloneProjectFactory.registerServicesForProjectEnvironment(
_projectEnvironment,
KtStaticModuleProvider(builtinsModule, ktModuleProjectStructure),
ktModuleProjectStructure.allKtModules(),
ktModuleProjectStructure.allSourceFiles(),
useSiteCompilerConfiguration.languageVersionSettings,
useSiteCompilerConfiguration.get(JVMConfigurationKeys.JDK_HOME)?.toPath(),
)