From 0f5d3b576dc4e38c48a950720439ce7e5b173c12 Mon Sep 17 00:00:00 2001 From: Jiaxiang Chen Date: Fri, 18 Aug 2023 16:44:12 -0700 Subject: [PATCH] UPDATE AA version: 1.9.20-dev-9102 --- gradle.properties | 2 +- .../ksp/impl/KotlinSymbolProcessing.kt | 32 ++++++++----------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/gradle.properties b/gradle.properties index cbc26e1257..2db7b95f6a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ junit5Version=5.8.2 junitPlatformVersion=1.8.2 googleTruthVersion=1.1 -aaKotlinBaseVersion=1.9.20-dev-6963 +aaKotlinBaseVersion=1.9.20-dev-9102 aaIntellijVersion=213.7172.25 aaGuavaVersion=29.0-jre aaAsmVersion=9.0 diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt index 2f583cf5db..94e81975de 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt @@ -78,19 +78,8 @@ import org.jetbrains.kotlin.analysis.project.structure.builder.buildKtSdkModule import org.jetbrains.kotlin.analysis.project.structure.builder.buildKtSourceModule import org.jetbrains.kotlin.analysis.project.structure.impl.KtModuleProviderImpl import org.jetbrains.kotlin.analysis.project.structure.impl.getSourceFilePaths -import org.jetbrains.kotlin.analysis.providers.KotlinAnnotationsResolverFactory -import org.jetbrains.kotlin.analysis.providers.KotlinDeclarationProviderFactory -import org.jetbrains.kotlin.analysis.providers.KotlinDeclarationProviderMerger -import org.jetbrains.kotlin.analysis.providers.KotlinModificationTrackerFactory -import org.jetbrains.kotlin.analysis.providers.KotlinPackageProviderFactory -import org.jetbrains.kotlin.analysis.providers.KotlinPsiDeclarationProviderFactory -import org.jetbrains.kotlin.analysis.providers.KotlinResolutionScopeProvider -import org.jetbrains.kotlin.analysis.providers.PackagePartProviderFactory -import org.jetbrains.kotlin.analysis.providers.impl.KotlinByModulesResolutionScopeProvider -import org.jetbrains.kotlin.analysis.providers.impl.KotlinStaticAnnotationsResolverFactory -import org.jetbrains.kotlin.analysis.providers.impl.KotlinStaticDeclarationProviderMerger -import org.jetbrains.kotlin.analysis.providers.impl.KotlinStaticModificationTrackerFactory -import org.jetbrains.kotlin.analysis.providers.impl.KotlinStaticPsiDeclarationProviderFactory +import org.jetbrains.kotlin.analysis.providers.* +import org.jetbrains.kotlin.analysis.providers.impl.* import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoot import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoots import org.jetbrains.kotlin.cli.common.config.kotlinSourceRoots @@ -225,13 +214,11 @@ class KotlinSymbolProcessing( // register services and build session val ktModuleProviderImpl = projectStructureProvider as KtModuleProviderImpl - val modules = ktModuleProviderImpl.mainModules - val allSourceFiles = ktModuleProviderImpl.allSourceFiles() + val modules = ktModuleProviderImpl.allKtModules + val allSourceFiles = ktModuleProviderImpl.allSourceFiles StandaloneProjectFactory.registerServicesForProjectEnvironment( kotlinCoreProjectEnvironment, projectStructureProvider, - modules, - allSourceFiles, ) val ktFiles = allSourceFiles.filterIsInstance() val libraryRoots = StandaloneProjectFactory.getAllBinaryRoots(modules, kotlinCoreProjectEnvironment) @@ -280,6 +267,10 @@ class KotlinSymbolProcessing( ) { val project = kotlinCoreProjectEnvironment.project project.apply { + registerService( + KotlinMessageBusProvider::class.java, + KotlinProjectMessageBusProvider::class.java + ) FirStandaloneServiceRegistrar.registerProjectServices(project) FirStandaloneServiceRegistrar.registerProjectExtensionPoints(project) FirStandaloneServiceRegistrar.registerProjectModelServices( @@ -291,6 +282,10 @@ class KotlinSymbolProcessing( KotlinModificationTrackerFactory::class.java, KotlinStaticModificationTrackerFactory::class.java ) + registerService( + KotlinGlobalModificationService::class.java, + KotlinStaticGlobalModificationService::class.java + ) registerService( KtLifetimeTokenProvider::class.java, KtReadActionConfinementLifetimeTokenProvider::class.java @@ -471,8 +466,7 @@ class KotlinSymbolProcessing( processors.forEach { it.finish() } } else { // Drop caches - KotlinModificationTrackerFactory.getService(project) - .incrementModificationsCount(includeBinaryTrackers = false) + KotlinGlobalModificationService.getInstance(project).publishGlobalModuleStateModification() KtAnalysisSessionProvider.getInstance(project).clearCaches() psiManager.dropResolveCaches() psiManager.dropPsiCaches()