[Injection] Minor: inline configureJavaTopDownAnalysis
It was used called only once, and hasn't provided any useful abstraction. Actually, this "cosmetic" refactoring makes similarities with other platform-specific container set-ups cleare, which allows to make further generalizations and simplifications.
This commit is contained in:
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.frontend.java.di
|
package org.jetbrains.kotlin.frontend.java.di
|
||||||
|
|
||||||
import com.intellij.openapi.project.Project
|
|
||||||
import com.intellij.psi.search.GlobalSearchScope
|
import com.intellij.psi.search.GlobalSearchScope
|
||||||
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
|
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
|
||||||
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsPackageFragmentProvider
|
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltInsPackageFragmentProvider
|
||||||
@@ -49,34 +48,6 @@ import org.jetbrains.kotlin.resolve.lazy.ResolveSession
|
|||||||
import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactory
|
import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactory
|
||||||
import org.jetbrains.kotlin.types.SubstitutingScopeProviderImpl
|
import org.jetbrains.kotlin.types.SubstitutingScopeProviderImpl
|
||||||
|
|
||||||
private fun StorageComponentContainer.configureJavaTopDownAnalysis(
|
|
||||||
moduleContentScope: GlobalSearchScope,
|
|
||||||
project: Project,
|
|
||||||
lookupTracker: LookupTracker,
|
|
||||||
expectActualTracker: ExpectActualTracker
|
|
||||||
) {
|
|
||||||
useInstance(moduleContentScope)
|
|
||||||
useInstance(lookupTracker)
|
|
||||||
useInstance(expectActualTracker)
|
|
||||||
useImpl<ResolveSession>()
|
|
||||||
|
|
||||||
useImpl<LazyTopDownAnalyzer>()
|
|
||||||
useImpl<JavaDescriptorResolver>()
|
|
||||||
useImpl<DeserializationComponentsForJava>()
|
|
||||||
|
|
||||||
useInstance(VirtualFileFinderFactory.getInstance(project).create(moduleContentScope))
|
|
||||||
|
|
||||||
useInstance(JavaPropertyInitializerEvaluatorImpl)
|
|
||||||
useImpl<AnnotationResolverImpl>()
|
|
||||||
useImpl<SignaturePropagatorImpl>()
|
|
||||||
useImpl<TraceBasedErrorReporter>()
|
|
||||||
useInstance(InternalFlexibleTypeTransformer)
|
|
||||||
|
|
||||||
useImpl<CompilerDeserializationConfiguration>()
|
|
||||||
|
|
||||||
useInstance(JavaDeprecationSettings)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun createContainerForLazyResolveWithJava(
|
fun createContainerForLazyResolveWithJava(
|
||||||
jvmPlatform: TargetPlatform,
|
jvmPlatform: TargetPlatform,
|
||||||
moduleContext: ModuleContext,
|
moduleContext: ModuleContext,
|
||||||
@@ -94,7 +65,22 @@ fun createContainerForLazyResolveWithJava(
|
|||||||
javaClassTracker: JavaClassesTracker? = null
|
javaClassTracker: JavaClassesTracker? = null
|
||||||
): StorageComponentContainer = createContainer("LazyResolveWithJava", JvmPlatformCompilerServices) {
|
): StorageComponentContainer = createContainer("LazyResolveWithJava", JvmPlatformCompilerServices) {
|
||||||
configureModule(moduleContext, jvmPlatform, JvmPlatformCompilerServices, bindingTrace)
|
configureModule(moduleContext, jvmPlatform, JvmPlatformCompilerServices, bindingTrace)
|
||||||
configureJavaTopDownAnalysis(moduleContentScope, moduleContext.project, lookupTracker, expectActualTracker)
|
|
||||||
|
useInstance(moduleContentScope)
|
||||||
|
useInstance(lookupTracker)
|
||||||
|
useInstance(expectActualTracker)
|
||||||
|
useImpl<ResolveSession>()
|
||||||
|
useImpl<LazyTopDownAnalyzer>()
|
||||||
|
useImpl<JavaDescriptorResolver>()
|
||||||
|
useImpl<DeserializationComponentsForJava>()
|
||||||
|
useInstance(VirtualFileFinderFactory.getInstance(moduleContext.project).create(moduleContentScope))
|
||||||
|
useInstance(JavaPropertyInitializerEvaluatorImpl)
|
||||||
|
useImpl<AnnotationResolverImpl>()
|
||||||
|
useImpl<SignaturePropagatorImpl>()
|
||||||
|
useImpl<TraceBasedErrorReporter>()
|
||||||
|
useInstance(InternalFlexibleTypeTransformer)
|
||||||
|
useImpl<CompilerDeserializationConfiguration>()
|
||||||
|
useInstance(JavaDeprecationSettings)
|
||||||
|
|
||||||
if (configureJavaClassFinder != null) {
|
if (configureJavaClassFinder != null) {
|
||||||
configureJavaClassFinder()
|
configureJavaClassFinder()
|
||||||
|
|||||||
Reference in New Issue
Block a user