diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/ucache/ScriptClassRootsUpdater.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/ucache/ScriptClassRootsUpdater.kt index 5e7e43cfe77..c13ea6e52c6 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/ucache/ScriptClassRootsUpdater.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/script/ucache/ScriptClassRootsUpdater.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.idea.core.script.ucache import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.runInEdt +import com.intellij.openapi.components.service import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.progress.ProgressIndicator import com.intellij.openapi.progress.ProgressManager @@ -27,6 +28,7 @@ import org.jetbrains.kotlin.idea.core.script.ScriptDependenciesModificationTrack import org.jetbrains.kotlin.idea.core.script.configuration.CompositeScriptConfigurationManager import org.jetbrains.kotlin.idea.core.script.scriptingDebugLog import org.jetbrains.kotlin.idea.core.util.EDT +import org.jetbrains.kotlin.idea.util.FirPluginOracleService import org.jetbrains.kotlin.idea.util.application.runReadAction import org.jetbrains.kotlin.idea.util.application.runWriteAction import org.jetbrains.kotlin.psi.KtFile @@ -243,6 +245,14 @@ abstract class ScriptClassRootsUpdater( if (openedScripts.isEmpty()) return + /** + * Scripts guts are everywhere in the plugin code, without them some functionality does not work, + * And with them some other fir plugin related is broken + * As FIR plugin does not have scripts support yet, just disabling not working one for now + */ + @Suppress("DEPRECATION") + if (project.service().isFirPlugin()) return + GlobalScope.launch(EDT(project)) { if (project.isDisposed) return@launch diff --git a/idea/idea-fir/src/org/jetbrains/kotlin/idea/util/FirPluginOracleServiceFirImpl.kt b/idea/idea-fir/src/org/jetbrains/kotlin/idea/util/FirPluginOracleServiceFirImpl.kt new file mode 100644 index 00000000000..7c48b5a8c01 --- /dev/null +++ b/idea/idea-fir/src/org/jetbrains/kotlin/idea/util/FirPluginOracleServiceFirImpl.kt @@ -0,0 +1,11 @@ +/* + * 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.util + +@Suppress("OverridingDeprecatedMember") +class FirPluginOracleServiceFirImpl : FirPluginOracleService() { + override fun isFirPlugin(): Boolean = true +} \ No newline at end of file diff --git a/idea/idea-frontend-independent/src/org/jetbrains/kotlin/idea/util/FirPluginOracle.kt b/idea/idea-frontend-independent/src/org/jetbrains/kotlin/idea/util/FirPluginOracle.kt new file mode 100644 index 00000000000..e2cf5ce1b74 --- /dev/null +++ b/idea/idea-frontend-independent/src/org/jetbrains/kotlin/idea/util/FirPluginOracle.kt @@ -0,0 +1,11 @@ +/* + * 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.util + +abstract class FirPluginOracleService { + @Deprecated("Should be used only as a very temporary solution to disable some FE1.0 functionality which is used in FIR plugin") + abstract fun isFirPlugin(): Boolean +} \ No newline at end of file diff --git a/idea/resources-fir/META-INF/plugin.xml b/idea/resources-fir/META-INF/plugin.xml index 47ca6a926f4..f4d4c1a2fd7 100644 --- a/idea/resources-fir/META-INF/plugin.xml +++ b/idea/resources-fir/META-INF/plugin.xml @@ -267,6 +267,11 @@ The Kotlin FIR plugin provides language support in IntelliJ IDEA and Android Stu + + + + diff --git a/idea/resources/META-INF/plugin-common.xml b/idea/resources/META-INF/plugin-common.xml index 80d74c30e22..e802ce65eb8 100644 --- a/idea/resources/META-INF/plugin-common.xml +++ b/idea/resources/META-INF/plugin-common.xml @@ -290,6 +290,10 @@ + + +