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:
+5
-7
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user