FIR IDE: use registry to obtain kotlin.use.fir.resolution
This commit is contained in:
@@ -5,15 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.fir
|
package org.jetbrains.kotlin.idea.fir
|
||||||
|
|
||||||
import com.intellij.ide.util.PropertiesComponent
|
import com.intellij.openapi.util.registry.Registry
|
||||||
|
|
||||||
// Just a wrapper to see whether resolve works via FIR or not
|
// Just a wrapper to see whether resolve works via FIR or not
|
||||||
object FirResolution {
|
object FirResolution {
|
||||||
private const val ENABLED_BY_DEFAULT = false
|
|
||||||
private const val optionName = "kotlin.use.fir.resolution"
|
private const val optionName = "kotlin.use.fir.resolution"
|
||||||
|
|
||||||
private val initialEnabledValue: Boolean by lazy {
|
private val initialEnabledValue: Boolean by lazy {
|
||||||
PropertiesComponent.getInstance().getBoolean(optionName, ENABLED_BY_DEFAULT)
|
Registry.`is`(optionName, /* defaultValue = */ false)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var changedEnabledValue: Boolean? = null
|
private var changedEnabledValue: Boolean? = null
|
||||||
@@ -22,6 +21,5 @@ object FirResolution {
|
|||||||
get() = changedEnabledValue ?: initialEnabledValue
|
get() = changedEnabledValue ?: initialEnabledValue
|
||||||
set(value) {
|
set(value) {
|
||||||
changedEnabledValue = value
|
changedEnabledValue = value
|
||||||
//PropertiesComponent.getInstance().setValue(optionName, value, ENABLED_BY_DEFAULT)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,6 +112,10 @@
|
|||||||
description="Add all transitive dependencies on MPP modules when Android project is imported"
|
description="Add all transitive dependencies on MPP modules when Android project is imported"
|
||||||
defaultValue="true"
|
defaultValue="true"
|
||||||
restartRequired="false"/>
|
restartRequired="false"/>
|
||||||
|
<registryKey key="kotlin.use.fir.resolution"
|
||||||
|
description="Use Kotlin resolution via frontend IR for reference resolve and diagnostics in IDEA"
|
||||||
|
defaultValue="false"
|
||||||
|
restartRequired="true"/>
|
||||||
<registryKey key="kotlin.gradle.scripts.useIdeaProjectImport"
|
<registryKey key="kotlin.gradle.scripts.useIdeaProjectImport"
|
||||||
description="Use IDEA project import mechanics to load Kotlin Gradle scripts configuration"
|
description="Use IDEA project import mechanics to load Kotlin Gradle scripts configuration"
|
||||||
defaultValue="false"
|
defaultValue="false"
|
||||||
|
|||||||
@@ -116,6 +116,10 @@
|
|||||||
description="Add all transitive dependencies on MPP modules when Android project is imported"
|
description="Add all transitive dependencies on MPP modules when Android project is imported"
|
||||||
defaultValue="true"
|
defaultValue="true"
|
||||||
restartRequired="false"/>
|
restartRequired="false"/>
|
||||||
|
<registryKey key="kotlin.use.fir.resolution"
|
||||||
|
description="Use Kotlin resolution via frontend IR for reference resolve and diagnostics in IDEA"
|
||||||
|
defaultValue="false"
|
||||||
|
restartRequired="true"/>
|
||||||
<fileEditorProvider implementation="org.jetbrains.kotlin.idea.scratch.ui.KtScratchFileEditorProvider"/>
|
<fileEditorProvider implementation="org.jetbrains.kotlin.idea.scratch.ui.KtScratchFileEditorProvider"/>
|
||||||
|
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|||||||
@@ -107,6 +107,10 @@
|
|||||||
description="Add all transitive dependencies on MPP modules when Android project is imported"
|
description="Add all transitive dependencies on MPP modules when Android project is imported"
|
||||||
defaultValue="true"
|
defaultValue="true"
|
||||||
restartRequired="false"/>
|
restartRequired="false"/>
|
||||||
|
<registryKey key="kotlin.use.fir.resolution"
|
||||||
|
description="Use Kotlin resolution via frontend IR for reference resolve and diagnostics in IDEA"
|
||||||
|
defaultValue="false"
|
||||||
|
restartRequired="true"/>
|
||||||
<fileEditorProvider implementation="org.jetbrains.kotlin.idea.scratch.ui.KtScratchFileEditorProvider"/>
|
<fileEditorProvider implementation="org.jetbrains.kotlin.idea.scratch.ui.KtScratchFileEditorProvider"/>
|
||||||
|
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|||||||
Reference in New Issue
Block a user