diff --git a/buildSrc/src/main/kotlin/intellijDependencies.kt b/buildSrc/src/main/kotlin/intellijDependencies.kt index 54c84ca84b1..bf03375bb04 100644 --- a/buildSrc/src/main/kotlin/intellijDependencies.kt +++ b/buildSrc/src/main/kotlin/intellijDependencies.kt @@ -137,7 +137,6 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, "-Dapple.awt.graphics.UseQuartz=true", "-Dsun.io.useCanonCaches=false", "-Dplugin.path=${ideaPluginDir.absolutePath}", - "-Dkotlin.internal.mode.enabled=true", "-Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar" ) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt index c8e340b8254..5b10c20278f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalMode.kt @@ -16,19 +16,15 @@ package org.jetbrains.kotlin.idea.actions.internal -import com.intellij.ide.util.PropertiesComponent +import com.intellij.openapi.application.ApplicationManager class KotlinInternalMode { companion object Instance { - private val INTERNAL_MODE_PROPERTY = "kotlin.internal.mode.enabled" - - var enabled: Boolean - get() = PropertiesComponent.getInstance()!!.getBoolean( - INTERNAL_MODE_PROPERTY, - System.getProperty(INTERNAL_MODE_PROPERTY) == "true" - ) - set(value) { - PropertiesComponent.getInstance()!!.setValue(INTERNAL_MODE_PROPERTY, value.toString()) - } + @Deprecated( + "Same as Application.isInternal()", + ReplaceWith("com.intellij.openapi.application.ApplicationManager.getApplication().isInternal") + ) + val enabled: Boolean + get() = ApplicationManager.getApplication().isInternal } } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/DebugInfoAnnotator.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/DebugInfoAnnotator.kt index bbbbc5c33b3..28dfaf89df6 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/DebugInfoAnnotator.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/DebugInfoAnnotator.kt @@ -72,7 +72,6 @@ class DebugInfoAnnotator : Annotator { } companion object { - val isDebugInfoEnabled: Boolean get() = KotlinInternalMode.enabled } diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt index 0365928d2c0..80e55bb202e 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt @@ -47,8 +47,6 @@ import java.util.* import kotlin.reflect.full.findAnnotation abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFixtureTestCaseBase() { - private var kotlinInternalModeOriginalValue = false - private val exceptions = ArrayList() protected val module: Module get() = myFixture.module @@ -60,9 +58,6 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix (StartupManager.getInstance(project) as StartupManagerImpl).runPostStartupActivities() VfsRootAccess.allowRootAccess(KotlinTestUtils.getHomeDirectory()) - kotlinInternalModeOriginalValue = KotlinInternalMode.enabled - KotlinInternalMode.enabled = true - project.getComponent(EditorTracker::class.java)?.projectOpened() invalidateLibraryCache(project) @@ -81,7 +76,6 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix override fun tearDown() { LoggedErrorProcessor.restoreDefaultProcessor() - KotlinInternalMode.enabled = kotlinInternalModeOriginalValue VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) doKotlinTearDown(project) { diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt.181 b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt.181 index c4dcbb4b94e..b6c4d3e2164 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt.181 +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt.181 @@ -47,8 +47,6 @@ import java.util.* import kotlin.reflect.full.findAnnotation abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFixtureTestCaseBase() { - private var kotlinInternalModeOriginalValue = false - private val exceptions = ArrayList() protected val module: Module get() = myFixture.module @@ -60,9 +58,6 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix (StartupManager.getInstance(project) as StartupManagerImpl).runPostStartupActivities() VfsRootAccess.allowRootAccess(KotlinTestUtils.getHomeDirectory()) - kotlinInternalModeOriginalValue = KotlinInternalMode.enabled - KotlinInternalMode.enabled = true - project.getComponent(EditorTracker::class.java)?.projectOpened() invalidateLibraryCache(project) @@ -80,7 +75,6 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix override fun tearDown() { LoggedErrorProcessor.restoreDefaultProcessor() - KotlinInternalMode.enabled = kotlinInternalModeOriginalValue VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) doKotlinTearDown(project) { diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt index 23819654002..7ce604536a2 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightPlatformCodeInsightFixtureTestCase.kt @@ -26,20 +26,14 @@ import org.jetbrains.kotlin.test.TestMetadata import kotlin.reflect.full.findAnnotation abstract class KotlinLightPlatformCodeInsightFixtureTestCase: LightPlatformCodeInsightFixtureTestCase() { - private var kotlinInternalModeOriginalValue: Boolean = false - override fun setUp() { super.setUp() (StartupManager.getInstance(project) as StartupManagerImpl).runPostStartupActivities() VfsRootAccess.allowRootAccess(KotlinTestUtils.getHomeDirectory()) invalidateLibraryCache(project) - - kotlinInternalModeOriginalValue = KotlinInternalMode.enabled - KotlinInternalMode.enabled = true } override fun tearDown() { - KotlinInternalMode.enabled = kotlinInternalModeOriginalValue VfsRootAccess.disallowRootAccess(KotlinTestUtils.getHomeDirectory()) doKotlinTearDown(project) { diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 834db15625b..72fca631b56 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -123,51 +123,44 @@ - - - + + + + + + + + - + - + - + - + + + + - - - - - - - - - - - - - + - diff --git a/idea/src/META-INF/plugin.xml.172 b/idea/src/META-INF/plugin.xml.172 index 789e2496069..723e8e3deac 100644 --- a/idea/src/META-INF/plugin.xml.172 +++ b/idea/src/META-INF/plugin.xml.172 @@ -82,9 +82,9 @@ - - + + @@ -123,51 +123,44 @@ - - - + + + + + + + + - + - + - + - + + + + - - - - - - - - - - - - - + - diff --git a/idea/src/META-INF/plugin.xml.181 b/idea/src/META-INF/plugin.xml.181 index 58a36f17102..7fb872bc835 100644 --- a/idea/src/META-INF/plugin.xml.181 +++ b/idea/src/META-INF/plugin.xml.181 @@ -82,9 +82,9 @@ - - + + @@ -123,51 +123,44 @@ - - - + + + + + + + + - + - + - + - + + + + - - - - - - - - - - - - - + - diff --git a/idea/src/META-INF/plugin.xml.182 b/idea/src/META-INF/plugin.xml.182 index b9ad25e14c3..ddad10d2f2e 100644 --- a/idea/src/META-INF/plugin.xml.182 +++ b/idea/src/META-INF/plugin.xml.182 @@ -83,9 +83,9 @@ - - + + @@ -124,51 +124,44 @@ - - - + + + + + + + + - + - + - + - + + + + - - - - - - - - - - - - - + - diff --git a/idea/src/META-INF/plugin.xml.as31 b/idea/src/META-INF/plugin.xml.as31 index e6d36188c75..f1240d2baea 100644 --- a/idea/src/META-INF/plugin.xml.as31 +++ b/idea/src/META-INF/plugin.xml.as31 @@ -82,9 +82,9 @@ - - + + @@ -123,51 +123,44 @@ - - - + + + + + + + + - + - + - + - + + + + - - - - - - - - - - - - - + - diff --git a/idea/src/META-INF/plugin.xml.as32 b/idea/src/META-INF/plugin.xml.as32 index b0cea8ea451..acf73307133 100644 --- a/idea/src/META-INF/plugin.xml.as32 +++ b/idea/src/META-INF/plugin.xml.as32 @@ -82,9 +82,9 @@ - - + + @@ -123,51 +123,44 @@ - - - + + + + + + + + - + - + - + - + + + + - - - - - - - - - - - - - + - diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalActionGroup.kt b/idea/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalActionGroup.kt deleted file mode 100644 index 48728d7dbac..00000000000 --- a/idea/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalActionGroup.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.idea.actions.internal - -import com.intellij.openapi.actionSystem.AnActionEvent -import com.intellij.openapi.actionSystem.DefaultActionGroup - -class KotlinInternalActionGroup : DefaultActionGroup() { - - override fun update(e: AnActionEvent) { - super.update(e) - e.presentation.isEnabledAndVisible = KotlinInternalMode.enabled - } -} \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalModeToggleAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalModeToggleAction.kt deleted file mode 100644 index b73d7d327f5..00000000000 --- a/idea/src/org/jetbrains/kotlin/idea/actions/internal/KotlinInternalModeToggleAction.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.idea.actions.internal - -import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer -import com.intellij.openapi.actionSystem.AnActionEvent -import com.intellij.openapi.actionSystem.ToggleAction - -class KotlinInternalModeToggleAction: ToggleAction("Kotlin Internal Mode", "Show debug highlighting", null) { - override fun isSelected(e: AnActionEvent?): Boolean { - return KotlinInternalMode.enabled - } - - override fun setSelected(e: AnActionEvent?, state: Boolean) { - KotlinInternalMode.enabled = state - - DaemonCodeAnalyzer.getInstance(e!!.project)!!.settingsChanged() - } -} diff --git a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/SuspendingCallHintsTest.kt b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/SuspendingCallHintsTest.kt index 13e9f5bc31c..9363003dfce 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/SuspendingCallHintsTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/parameterInfo/SuspendingCallHintsTest.kt @@ -14,14 +14,9 @@ class SuspendingCallHintsTest : KotlinLightCodeInsightFixtureTestCase() { override fun getProjectDescriptor(): KotlinLightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE fun check(text: String) { - KotlinInternalMode.enabled = true - try { - HintType.SUSPENDING_CALL.option.set(true) - myFixture.configureByText("A.kt", text) - myFixture.testInlays() - } finally { - KotlinInternalMode.enabled = false - } + HintType.SUSPENDING_CALL.option.set(true) + myFixture.configureByText("A.kt", text) + myFixture.testInlays() } fun testSimple() {