diff --git a/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/base/plugin/SystemPropertyUtils.kt b/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/base/plugin/SystemPropertyUtils.kt index a5cb1ed86f75..6dfe0fabe283 100644 --- a/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/base/plugin/SystemPropertyUtils.kt +++ b/plugins/kotlin/base/plugin/src/org/jetbrains/kotlin/idea/base/plugin/SystemPropertyUtils.kt @@ -1,6 +1,4 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -@file:JvmName("SystemPropertyUtils") - package org.jetbrains.kotlin.idea.base.plugin import org.jetbrains.annotations.NonNls diff --git a/plugins/kotlin/base/test/test/org/jetbrains/kotlin/idea/test/ExpectedPluginModeProvider.kt b/plugins/kotlin/base/test/test/org/jetbrains/kotlin/idea/test/ExpectedPluginModeProvider.kt index 2282b1c25649..53336325d2d1 100644 --- a/plugins/kotlin/base/test/test/org/jetbrains/kotlin/idea/test/ExpectedPluginModeProvider.kt +++ b/plugins/kotlin/base/test/test/org/jetbrains/kotlin/idea/test/ExpectedPluginModeProvider.kt @@ -1,6 +1,9 @@ // Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.idea.test +import com.intellij.openapi.Disposable +import com.intellij.openapi.util.Disposer +import com.intellij.util.ThrowableRunnable import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginModeProvider import org.jetbrains.kotlin.idea.base.plugin.useK2Plugin @@ -9,9 +12,13 @@ import org.junit.Assert interface ExpectedPluginModeProvider { val pluginMode: KotlinPluginMode + + // not a property for compatibility reasons + fun getTestRootDisposable(): Disposable } -fun ExpectedPluginModeProvider.assertKotlinPluginMode() { +// do not expose +private fun ExpectedPluginModeProvider.assertKotlinPluginMode() { val expectedPluginMode = pluginMode val actualPluginMode = KotlinPluginModeProvider.currentPluginMode @@ -26,8 +33,14 @@ fun ExpectedPluginModeProvider.assertKotlinPluginMode() { * Executes a [setUp] function after enabling the K1 or K2 Kotlin plugin in system properties. * The correct Kotlin plugin should be set up after [setUp] finishes. */ -fun ExpectedPluginModeProvider.setUpWithKotlinPlugin(setUp: () -> Unit) { +fun ExpectedPluginModeProvider.setUpWithKotlinPlugin(setUp: ThrowableRunnable<*>) { + val oldUseK2Plugin = useK2Plugin useK2Plugin = pluginMode == KotlinPluginMode.K2 - setUp() + Disposer.register(getTestRootDisposable()) { + useK2Plugin = oldUseK2Plugin + } + + setUp.run() + assertKotlinPluginMode() } diff --git a/plugins/kotlin/gradle/gradle-java/tests.k2/test/org/jetbrains/kotlin/idea/k2/highlighting/AbstractK2GradleBuildFileHighlightingTest.kt b/plugins/kotlin/gradle/gradle-java/tests.k2/test/org/jetbrains/kotlin/idea/k2/highlighting/AbstractK2GradleBuildFileHighlightingTest.kt index 346385b211f3..fe76ddbca938 100644 --- a/plugins/kotlin/gradle/gradle-java/tests.k2/test/org/jetbrains/kotlin/idea/k2/highlighting/AbstractK2GradleBuildFileHighlightingTest.kt +++ b/plugins/kotlin/gradle/gradle-java/tests.k2/test/org/jetbrains/kotlin/idea/k2/highlighting/AbstractK2GradleBuildFileHighlightingTest.kt @@ -7,7 +7,7 @@ import com.intellij.testFramework.common.runAll import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode import org.jetbrains.kotlin.idea.codeInsight.gradle.AbstractGradleBuildFileHighlightingTest import org.jetbrains.kotlin.idea.test.ExpectedPluginModeProvider -import org.jetbrains.kotlin.idea.test.assertKotlinPluginMode +import org.jetbrains.kotlin.idea.test.setUpWithKotlinPlugin private const val SCRIPTING_ENABLED_FLAG = "kotlin.k2.scripting.enabled" @@ -25,8 +25,7 @@ abstract class AbstractK2GradleBuildFileHighlightingTest : AbstractGradleBuildFi Registry.get(SCRIPTING_ENABLED_FLAG).setValue(true) - super.setUp() - assertKotlinPluginMode() + setUpWithKotlinPlugin { super.setUp() } } override fun tearDown() { diff --git a/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/gradle/multiplatformTests/AbstractKotlinMppGradleImportingTest.kt b/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/gradle/multiplatformTests/AbstractKotlinMppGradleImportingTest.kt index fc2b8ec807a6..b3b3c044fed4 100644 --- a/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/gradle/multiplatformTests/AbstractKotlinMppGradleImportingTest.kt +++ b/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/gradle/multiplatformTests/AbstractKotlinMppGradleImportingTest.kt @@ -8,7 +8,6 @@ import com.intellij.openapi.vfs.VirtualFile import com.intellij.testFramework.TestDataPath import com.intellij.testFramework.VfsTestUtil import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory -import com.intellij.util.ThrowableRunnable import org.jetbrains.kotlin.gradle.multiplatformTests.testFeatures.* import org.jetbrains.kotlin.gradle.multiplatformTests.testFeatures.checkers.* import org.jetbrains.kotlin.gradle.multiplatformTests.testFeatures.checkers.contentRoots.ContentRootsChecker @@ -22,7 +21,6 @@ import org.jetbrains.kotlin.gradle.multiplatformTests.testFeatures.checkers.runC import org.jetbrains.kotlin.gradle.multiplatformTests.testFeatures.checkers.workspace.GeneralWorkspaceChecks import org.jetbrains.kotlin.gradle.multiplatformTests.testFeatures.checkers.workspace.WorkspaceChecksDsl import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode -import org.jetbrains.kotlin.idea.base.plugin.useK2Plugin import org.jetbrains.kotlin.idea.base.test.AndroidStudioTestUtils import org.jetbrains.kotlin.idea.codeInsight.gradle.KotlinGradleImportingTestCase import org.jetbrains.kotlin.idea.codeInsight.gradle.PluginTargetVersionsRule @@ -130,10 +128,6 @@ abstract class AbstractKotlinMppGradleImportingTest : GradleImportingTestCase(), // Temporary hack allowing to reuse new test runner in selected smoke tests for runs on linux-hosts open val allowOnNonMac: Boolean = false - // Captures the state of the 'idea.kotlin.plugin.use.k2' system property before the test. - // Used for restoring the property's value after the test. - private var beforeSetupK2PluginProperty: Boolean? = null - override val pluginMode: KotlinPluginMode get() = KotlinPluginMode.K1 @@ -205,8 +199,6 @@ abstract class AbstractKotlinMppGradleImportingTest : GradleImportingTestCase(), assumeTrue("Test is ignored because it requires Mac-host", HostManager.hostIsMac) } - // It is important to set up property before plugin loading as the property affects plugin.xml parsing - beforeSetupK2PluginProperty = useK2Plugin setUpWithKotlinPlugin { // Hack: usually this is set-up by JUnit's Parametrized magic, but // our tests source versions from `kotlinTestPropertiesService`, not from @@ -224,13 +216,6 @@ abstract class AbstractKotlinMppGradleImportingTest : GradleImportingTestCase(), "-XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${System.getProperty("user.dir")}" } - final override fun tearDown() { - runAll( - { super.tearDown() }, - { useK2Plugin = beforeSetupK2PluginProperty }, - ) - } - override fun setUpFixtures() { myTestFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(getName()).fixture context.mutableCodeInsightTestFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(myTestFixture) @@ -239,9 +224,9 @@ abstract class AbstractKotlinMppGradleImportingTest : GradleImportingTestCase(), override fun tearDownFixtures() { runAll( - ThrowableRunnable { context.codeInsightTestFixture.tearDown() }, - ThrowableRunnable { context.mutableCodeInsightTestFixture = null }, - ThrowableRunnable { myTestFixture = null }, + { context.codeInsightTestFixture.tearDown() }, + { context.mutableCodeInsightTestFixture = null }, + { myTestFixture = null }, ) } diff --git a/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/idea/run/gradle/KotlinGradleProjectRunConfigurationTestCase.kt b/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/idea/run/gradle/KotlinGradleProjectRunConfigurationTestCase.kt index e58dc15cbba7..7228ce732744 100644 --- a/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/idea/run/gradle/KotlinGradleProjectRunConfigurationTestCase.kt +++ b/plugins/kotlin/gradle/gradle-java/tests.shared/test/org/jetbrains/kotlin/idea/run/gradle/KotlinGradleProjectRunConfigurationTestCase.kt @@ -1,11 +1,14 @@ // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.jetbrains.kotlin.idea.run.gradle +import com.intellij.openapi.Disposable import com.intellij.openapi.application.runReadAction +import com.intellij.openapi.util.Disposer import org.gradle.util.GradleVersion import org.jetbrains.kotlin.idea.run.getConfiguration import org.jetbrains.kotlin.idea.test.ExpectedPluginModeProvider -import org.jetbrains.kotlin.idea.test.assertKotlinPluginMode +import org.jetbrains.kotlin.idea.test.runAll +import org.jetbrains.kotlin.idea.test.setUpWithKotlinPlugin import org.jetbrains.kotlin.idea.testFramework.gradle.KotlinGradleProjectTestCase import org.jetbrains.plugins.gradle.testFramework.annotations.AllGradleVersionsSource import org.junit.jupiter.params.ParameterizedTest @@ -14,9 +17,21 @@ import kotlin.test.assertEquals abstract class KotlinGradleProjectRunConfigurationTestCase : KotlinGradleProjectTestCase(), ExpectedPluginModeProvider { + private lateinit var testRootDisposable: Disposable + + final override fun getTestRootDisposable(): Disposable = testRootDisposable + override fun setUp() { - super.setUp() - assertKotlinPluginMode() + testRootDisposable = Disposer.newCheckedDisposable() + + setUpWithKotlinPlugin { super.setUp() } + } + + override fun tearDown() { + runAll( + { Disposer.dispose(testRootDisposable) }, + { super.tearDown() }, + ) } @ParameterizedTest diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/hints/AbstractKotlinInlayHintsProviderTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/hints/AbstractKotlinInlayHintsProviderTest.kt index eecb6700470a..57535b9e85f2 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/hints/AbstractKotlinInlayHintsProviderTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/hints/AbstractKotlinInlayHintsProviderTest.kt @@ -14,8 +14,8 @@ import junit.framework.ComparisonFailure import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode import org.jetbrains.kotlin.idea.test.ExpectedPluginModeProvider import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor -import org.jetbrains.kotlin.idea.test.assertKotlinPluginMode import org.jetbrains.kotlin.idea.test.runAll +import org.jetbrains.kotlin.idea.test.setUpWithKotlinPlugin import java.io.File abstract class AbstractKotlinInlayHintsProviderTest : DeclarativeInlayHintsProviderTestCase(), @@ -25,7 +25,8 @@ abstract class AbstractKotlinInlayHintsProviderTest : DeclarativeInlayHintsProvi get() = KotlinPluginMode.K1 override fun setUp() { - super.setUp() + setUpWithKotlinPlugin { super.setUp() } + customToStringProvider = { element -> val virtualFile = element.containingFile.virtualFile val jarFileSystem = virtualFile.fileSystem as? JarFileSystem @@ -35,7 +36,6 @@ abstract class AbstractKotlinInlayHintsProviderTest : DeclarativeInlayHintsProvi } ?: virtualFile.name "[$path:${if (jarFileSystem != null) "*" else element.startOffset.toString()}]" } - assertKotlinPluginMode() } override fun tearDown() { diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/KotlinAutoPopupTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/KotlinAutoPopupTest.kt index d27ba917539c..f9e8f27fbbfd 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/KotlinAutoPopupTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/editor/KotlinAutoPopupTest.kt @@ -5,7 +5,7 @@ import com.intellij.testFramework.fixtures.CompletionAutoPopupTestCase import org.jetbrains.kotlin.idea.KotlinFileType import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode import org.jetbrains.kotlin.idea.test.ExpectedPluginModeProvider -import org.jetbrains.kotlin.idea.test.assertKotlinPluginMode +import org.jetbrains.kotlin.idea.test.setUpWithKotlinPlugin import org.junit.internal.runners.JUnit38ClassRunner import org.junit.runner.RunWith import kotlin.test.assertContains @@ -18,8 +18,7 @@ open class KotlinAutoPopupTest : CompletionAutoPopupTestCase(), get() = KotlinPluginMode.K1 override fun setUp() { - super.setUp() - assertKotlinPluginMode() + setUpWithKotlinPlugin { super.setUp() } } fun testAfterLT() { diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/AbstractRunConfigurationBaseTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/AbstractRunConfigurationBaseTest.kt index d32545f5513d..7fdb93b23d44 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/AbstractRunConfigurationBaseTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/run/AbstractRunConfigurationBaseTest.kt @@ -18,7 +18,6 @@ import com.intellij.openapi.vfs.VirtualFile import com.intellij.testFramework.IdeaTestUtil import com.intellij.testFramework.PlatformTestUtil import com.intellij.testFramework.PsiTestUtil -import com.intellij.util.ThrowableRunnable import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode import org.jetbrains.kotlin.idea.base.util.allScope import org.jetbrains.kotlin.idea.stubindex.KotlinFullClassNameIndex @@ -86,12 +85,16 @@ abstract class AbstractRunConfigurationBaseTest : KotlinCodeInsightTestCase(), override val pluginMode: KotlinPluginMode get() = KotlinPluginMode.K1 + override fun setUp() { + setUpWithKotlinPlugin { super.setUp() } + } + override fun tearDown() { runAll( - ThrowableRunnable { unconfigureDefaultModule() }, - ThrowableRunnable { unconfigureOtherModules() }, - ThrowableRunnable { configuredModules = emptyList() }, - ThrowableRunnable { super.tearDown() } + { unconfigureDefaultModule() }, + { unconfigureOtherModules() }, + { configuredModules = emptyList() }, + { super.tearDown() }, ) } @@ -131,7 +134,6 @@ abstract class AbstractRunConfigurationBaseTest : KotlinCodeInsightTestCase(), platform.addJdk(testRootDisposable) configuredModules = configureModules(projectDir, projectBaseDir, platform) - assertKotlinPluginMode() } } diff --git a/plugins/kotlin/jvm-debugger/test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCase.kt b/plugins/kotlin/jvm-debugger/test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCase.kt index 869ed5c96136..7799ff5bb71b 100644 --- a/plugins/kotlin/jvm-debugger/test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCase.kt +++ b/plugins/kotlin/jvm-debugger/test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinDescriptorTestCase.kt @@ -155,13 +155,12 @@ abstract class KotlinDescriptorTestCase : DescriptorTestCase(), protected open val compileWithK2: Boolean get() = false override fun setUp() { - super.setUp() + setUpWithKotlinPlugin { super.setUp() } registerEvaluatorBackend() KotlinEvaluator.LOG_COMPILATIONS = true logPropagator = LogPropagator(::systemLogger).apply { attach() } - assertKotlinPluginMode() atDebuggerTearDown { restoreEvaluatorBackend() } atDebuggerTearDown { logPropagator = null } atDebuggerTearDown { logPropagator?.detach() } diff --git a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/AbstractMultiModuleTest.kt b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/AbstractMultiModuleTest.kt index 65d09ff8f635..5d1bcaf03fb8 100644 --- a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/AbstractMultiModuleTest.kt +++ b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/AbstractMultiModuleTest.kt @@ -62,11 +62,10 @@ abstract class AbstractMultiModuleTest : DaemonAnalyzerTestCase(), } override fun setUp() { - super.setUp() + setUpWithKotlinPlugin { super.setUp() } enableKotlinOfficialCodeStyle(project) vfsDisposable = allowProjectRootAccess(this) - assertKotlinPluginMode() } // [TargetSupportException] can be thrown by the multiplatform test setup when a test artifact doesn't exist for the host platform. @@ -124,9 +123,9 @@ abstract class AbstractMultiModuleTest : DaemonAnalyzerTestCase(), override fun tearDown() { runAll( - ThrowableRunnable { disposeVfsRootAccess(vfsDisposable) }, - ThrowableRunnable { disableKotlinOfficialCodeStyle(project) }, - ThrowableRunnable { super.tearDown() } + { disposeVfsRootAccess(vfsDisposable) }, + { disableKotlinOfficialCodeStyle(project) }, + { super.tearDown() }, ) } diff --git a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt index 5d02c879dd4e..8552555e50be 100644 --- a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt +++ b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt @@ -4,7 +4,6 @@ package org.jetbrains.kotlin.idea.test import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase -import com.intellij.util.ThrowableRunnable import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode import org.jetbrains.kotlin.idea.base.test.KotlinRoot import java.io.File @@ -16,7 +15,8 @@ abstract class KotlinLightPlatformCodeInsightFixtureTestCase : LightPlatformCode get() = KotlinPluginMode.K1 override fun setUp() { - super.setUp() + setUpWithKotlinPlugin { super.setUp() } + enableKotlinOfficialCodeStyle(project) VfsRootAccess.allowRootAccess(myFixture.testRootDisposable, KotlinRoot.DIR.path) @@ -24,13 +24,12 @@ abstract class KotlinLightPlatformCodeInsightFixtureTestCase : LightPlatformCode if (pluginMode == KotlinPluginMode.K1) { invalidateLibraryCache(project) } - assertKotlinPluginMode() } override fun tearDown() { runAll( - ThrowableRunnable { disableKotlinOfficialCodeStyle(project) }, - ThrowableRunnable { super.tearDown() }, + { disableKotlinOfficialCodeStyle(project) }, + { super.tearDown() }, ) } diff --git a/plugins/kotlin/tests-common/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java b/plugins/kotlin/tests-common/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java index 74fbdecd1224..b39ec35cb8e2 100644 --- a/plugins/kotlin/tests-common/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java +++ b/plugins/kotlin/tests-common/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCaseBase.java @@ -15,7 +15,6 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.idea.base.plugin.KotlinPluginMode; -import org.jetbrains.kotlin.idea.base.plugin.SystemPropertyUtils; import java.io.File; import java.io.FileOutputStream; @@ -26,7 +25,9 @@ import java.nio.file.Path; import java.util.Collection; import java.util.HashSet; -public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightJavaCodeInsightFixtureTestCase { +public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightJavaCodeInsightFixtureTestCase + implements ExpectedPluginModeProvider { + @NotNull @Override public Project getProject() { @@ -49,26 +50,13 @@ public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightJav @Override protected void setUp() throws Exception { - boolean useK2Plugin = isFirPlugin(); - SystemPropertyUtils.setUseK2Plugin(useK2Plugin); - super.setUp(); - - // todo test classes should inherit ExpectedPluginModeProvider directly - ExpectedPluginModeProviderKt.assertKotlinPluginMode(new ExpectedPluginModeProvider() { - - @Override - public @NotNull KotlinPluginMode getPluginMode() { - return KotlinPluginMode.of(useK2Plugin); - } - }); + ExpectedPluginModeProviderKt.setUpWithKotlinPlugin(this, super::setUp); } @Override protected void tearDown() throws Exception { - RunAll.runAll( - () -> myTempFiles.deleteAll(), - () -> super.tearDown() - ); + RunAll.runAll(myTempFiles::deleteAll, + super::tearDown); } @NotNull @@ -102,7 +90,14 @@ public abstract class KotlinLightCodeInsightFixtureTestCaseBase extends LightJav return LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file); } + // todo replace with getPluginMode overrides + // todo remove the method protected boolean isFirPlugin() { return false; } + + @Override + public final @NotNull KotlinPluginMode getPluginMode() { + return KotlinPluginMode.of(isFirPlugin()); + } }