Add default values to KotlinTypeMapper constructor, remove them from call sites

~
This commit is contained in:
Mikhael Bogdanov
2019-03-05 12:00:55 +01:00
parent cc0c3b1592
commit 20da778046
13 changed files with 33 additions and 53 deletions
@@ -134,11 +134,9 @@ class IDELightClassGenerationSupport(private val project: Project) : LightClassG
override val typeMapper: KotlinTypeMapper by lazyPub {
KotlinTypeMapper(
BindingContext.EMPTY, ClassBuilderMode.LIGHT_CLASSES,
IncompatibleClassTracker.DoNothing, moduleName,
JvmTarget.JVM_1_8,
KotlinTypeMapper.LANGUAGE_VERSION_SETTINGS_DEFAULT, // TODO use proper LanguageVersionSettings
false,
KotlinType::cleanFromAnonymousTypes
moduleName, KotlinTypeMapper.LANGUAGE_VERSION_SETTINGS_DEFAULT, // TODO use proper LanguageVersionSettings
jvmTarget = JvmTarget.JVM_1_8,
typePreprocessor = KotlinType::cleanFromAnonymousTypes
)
}
})
@@ -10,9 +10,7 @@ import com.intellij.openapi.progress.ProcessCanceledException
import com.intellij.psi.PsiElement
import com.sun.jdi.*
import org.jetbrains.kotlin.codegen.ClassBuilderMode
import org.jetbrains.kotlin.codegen.state.IncompatibleClassTracker
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
import org.jetbrains.kotlin.config.JvmTarget
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.diagnostics.DiagnosticUtils
import org.jetbrains.kotlin.idea.caches.resolve.analyze
@@ -344,7 +342,9 @@ abstract class FileRankingCalculator(private val checkClassFqName: Boolean = tru
private fun makeTypeMapper(bindingContext: BindingContext): KotlinTypeMapper {
return KotlinTypeMapper(
bindingContext, ClassBuilderMode.LIGHT_CLASSES, IncompatibleClassTracker.DoNothing, "debugger", JvmTarget.DEFAULT,
bindingContext,
ClassBuilderMode.LIGHT_CLASSES,
"debugger",
KotlinTypeMapper.LANGUAGE_VERSION_SETTINGS_DEFAULT // TODO use proper LanguageVersionSettings
)
}