Backend: remove psi files from generation state

pass them explicitly to all destinations. This is a step in attempt to
abstract dependencies on PSI in the GenerationState and related places.
This commit is contained in:
Ilya Chernikov
2022-02-15 17:22:24 +03:00
committed by teamcity
parent da41fddabb
commit 2044754628
22 changed files with 64 additions and 62 deletions
@@ -46,21 +46,21 @@ fun buildLightClass(
try {
val classBuilderFactory = KotlinLightClassBuilderFactory(createJavaFileStub(packageFqName, files))
val state = GenerationState.Builder(
project,
classBuilderFactory,
context.module,
context.bindingContext,
files.toList(),
context.languageVersionSettings?.let {
CompilerConfiguration().apply {
languageVersionSettings = it
put(JVMConfigurationKeys.JVM_TARGET, context.jvmTarget)
isReadOnly = true
}
} ?: CompilerConfiguration.EMPTY
project,
classBuilderFactory,
context.module,
context.bindingContext,
context.languageVersionSettings?.let {
CompilerConfiguration().apply {
languageVersionSettings = it
put(JVMConfigurationKeys.JVM_TARGET, context.jvmTarget)
isReadOnly = true
}
} ?: CompilerConfiguration.EMPTY
).generateDeclaredClassFilter(generateClassFilter).wantsDiagnostics(false).build()
state.beforeCompile()
state.oldBEInitTrace(files)
generate(state, files)