Pass CompilerConfiguration to TopDownAnalyzerFacadeForJVM

In most cases, the configuration can be loaded from KotlinCoreEnvironment. In
other cases, such as IDE tests, there's no environment, so we pass EMPTY. Since
currently the configuration is only used to load incremental compilation
components and module information, it's fine to pass EMPTY
This commit is contained in:
Alexander Udalov
2016-05-19 16:21:45 +03:00
parent 6c0ff40197
commit 6d6488e795
8 changed files with 45 additions and 62 deletions
@@ -18,11 +18,11 @@ package org.jetbrains.kotlin.idea.decompiler.textBuilder
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil
import org.jetbrains.kotlin.idea.caches.resolve.IDEPackagePartProvider
import org.jetbrains.kotlin.idea.decompiler.classFile.DeserializerForClassfileDecompiler
import org.jetbrains.kotlin.idea.decompiler.classFile.buildDecompiledTextForClassFile
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
@@ -51,7 +51,7 @@ class DecompiledTextConsistencyTest : TextConsistencyBaseTest() {
override fun getModuleDescriptor(): ModuleDescriptor =
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationWithCustomContext(
TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(project, JvmResolveUtil.TEST_MODULE_NAME),
listOf(), BindingTraceContext(), null, null,
listOf(), BindingTraceContext(), CompilerConfiguration.EMPTY,
IDEPackagePartProvider(GlobalSearchScope.allScope(project))
).moduleDescriptor