Move module creation into TopDownAnalyzerFacadeForJVM#analyzeFilesWithJavaIntegration

The only place where the logic has changed is in AbstractDiagnosticsTest, where
modules are already created and sealed before the analysis. Copy-paste the
container creation logic there (it's almost fine because it's also present in a
bunch of other tests), and simplify it: get rid of incremental compilation and
other stuff irrelevant for diagnostic tests.

This is needed to make analyzeFilesWithJavaIntegration configure the module
properly before sealing it
This commit is contained in:
Alexander Udalov
2016-09-27 15:30:33 +03:00
parent 596fdab2f2
commit a5a874f23f
7 changed files with 51 additions and 51 deletions
@@ -47,13 +47,11 @@ class DecompiledTextConsistencyTest : TextConsistencyBaseTest() {
override fun getDecompiledText(packageFile: VirtualFile, resolver: ResolverForDecompiler?): String =
(resolver?.let { buildDecompiledTextForClassFile(packageFile, it) } ?: buildDecompiledTextForClassFile(packageFile)).text
override fun getModuleDescriptor(): ModuleDescriptor {
val configuration = KotlinTestUtils.newConfiguration()
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(project, configuration), listOf(), BindingTraceContext(),
configuration, IDEPackagePartProvider(GlobalSearchScope.allScope(project))
).moduleDescriptor
}
override fun getModuleDescriptor(): ModuleDescriptor =
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
project, listOf(), BindingTraceContext(), KotlinTestUtils.newConfiguration(),
IDEPackagePartProvider(GlobalSearchScope.allScope(project))
).moduleDescriptor
override fun getProjectDescriptor() =
object : KotlinWithJdkAndRuntimeLightProjectDescriptor() {