FIR IDE: remove enabled/disable FirResolution by registry

This separation is made based on plugins now
This commit is contained in:
Ilya Kirillov
2020-06-04 13:14:23 +03:00
parent 19d721d262
commit 7ac48f441d
4 changed files with 1 additions and 34 deletions
@@ -17,7 +17,6 @@ abstract class AbstractFirPsiCheckerTest : AbstractPsiCheckerTest() {
override fun setUp() {
super.setUp()
FirResolution.enabled = true
}
override fun doTest(filePath: String) {
@@ -48,7 +47,6 @@ abstract class AbstractFirPsiCheckerTest : AbstractPsiCheckerTest() {
}
override fun tearDown() {
FirResolution.enabled = false
super.tearDown()
}
}
@@ -6,7 +6,6 @@
package org.jetbrains.kotlin.idea.resolve
import org.jetbrains.kotlin.idea.completion.test.configureWithExtraFile
import org.jetbrains.kotlin.idea.fir.low.level.api.FirResolution
import org.jetbrains.kotlin.idea.test.KotlinLightProjectDescriptor
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
import org.jetbrains.kotlin.test.InTextDirectivesUtils
@@ -19,7 +18,6 @@ abstract class AbstractFirReferenceResolveTest : AbstractReferenceResolveTest()
override fun setUp() {
super.setUp()
FirResolution.enabled = true
}
override fun doTest(path: String) {
@@ -37,7 +35,6 @@ abstract class AbstractFirReferenceResolveTest : AbstractReferenceResolveTest()
}
override fun tearDown() {
FirResolution.enabled = false
super.tearDown()
}
}
@@ -1,25 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.fir.low.level.api
import com.intellij.openapi.util.registry.Registry
// Just a wrapper to see whether resolve works via FIR or not
object FirResolution {
private const val optionName = "kotlin.use.fir.resolution"
private val initialEnabledValue: Boolean by lazy {
Registry.`is`(optionName, /* defaultValue = */ true)
}
private var changedEnabledValue: Boolean? = null
var enabled: Boolean
get() = changedEnabledValue ?: initialEnabledValue
set(value) {
changedEnabledValue = value
}
}
+1 -4
View File
@@ -113,10 +113,7 @@
description="Add all transitive dependencies on MPP modules when Android project is imported"
defaultValue="true"
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"
description="Use IDEA project import mechanics to load Kotlin Gradle scripts configuration"
defaultValue="false"