Revert "[kotlin] fix a case when a user enables and then disables K2 mode, IJ will stay in K2 mode after K2 mode is enabled by default"

This reverts commit 50aa33bc89c923bb15e7689caf056509cfa9741f.

To make it possible for KTIJ-30761 to enable K2 by default when it was not disabled by the user

GitOrigin-RevId: abea9cdb2274b2439340a9d851c3b39a5a4f56bd
This commit is contained in:
Ilya Kirillov
2024-07-28 20:47:02 +00:00
committed by intellij-monorepo-bot
parent 7b492fd2f5
commit e752c1c3c7
@@ -158,15 +158,11 @@ class KotlinPluginKindSwitcherController {
const val USE_K2_PLUGIN_VM_OPTION_PREFIX: @NonNls String = "-D$USE_K2_PLUGIN_PROPERTY_NAME="
private var useK2Plugin: Boolean
get() = VMOptions.readOption(USE_K2_PLUGIN_VM_OPTION_PREFIX, /*effective=*/ false)?.toBoolean() ?: false
private var useK2Plugin: Boolean?
get() = VMOptions.readOption(USE_K2_PLUGIN_VM_OPTION_PREFIX, /*effective=*/ false)?.toBoolean()
set(value) {
if (value) {
VMOptions.setOption(USE_K2_PLUGIN_VM_OPTION_PREFIX, "true")
} else {
VMOptions.setOption(USE_K2_PLUGIN_VM_OPTION_PREFIX, null/*null means remove the value*/)
}
VMOptions.setOption(USE_K2_PLUGIN_VM_OPTION_PREFIX, value?.toString())
}
private fun getPluginKindByVmOptions(): KotlinPluginMode =
KotlinPluginMode.of(useK2Plugin = useK2Plugin)
KotlinPluginMode.of(useK2Plugin = useK2Plugin == true)