FIR IDE: disable some script stuff in FIR plugin as causes exceptions
This commit is contained in:
+10
@@ -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<FirPluginOracleService>().isFirPlugin()) return
|
||||
|
||||
GlobalScope.launch(EDT(project)) {
|
||||
if (project.isDisposed) return@launch
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -267,6 +267,11 @@ The Kotlin FIR plugin provides language support in IntelliJ IDEA and Android Stu
|
||||
<!-- <classesWithAnnotatedMembersSearch implementation="org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinClassesWithAnnotatedMembersSearcher"/>-->
|
||||
<!-- <methodReferencesSearch implementation="org.jetbrains.kotlin.idea.search.ideaExtensions.DefaultAnnotationMethodKotlinImplicitReferenceSearcher"/>-->
|
||||
|
||||
<projectService serviceInterface="org.jetbrains.kotlin.idea.util.FirPluginOracleService"
|
||||
serviceImplementation="org.jetbrains.kotlin.idea.util.FirPluginOracleServiceFirImpl"/>
|
||||
|
||||
|
||||
|
||||
<readWriteAccessDetector implementation="org.jetbrains.kotlin.idea.search.ideaExtensions.KotlinReadWriteAccessDetector" id="kotlin"/>
|
||||
|
||||
|
||||
|
||||
@@ -290,6 +290,10 @@
|
||||
<projectService serviceInterface="org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupport"
|
||||
serviceImplementation="org.jetbrains.kotlin.idea.search.KotlinSearchUsagesSupportImpl"/>
|
||||
|
||||
<projectService serviceInterface="org.jetbrains.kotlin.idea.util.FirPluginOracleService"
|
||||
serviceImplementation="org.jetbrains.kotlin.idea.util.FirPluginOracleServiceFE10Impl"/>
|
||||
|
||||
|
||||
<errorHandler implementation="org.jetbrains.kotlin.idea.reporter.KotlinReportSubmitter"/>
|
||||
|
||||
<registryKey key="kotlin.dispatch.thread.resolve.check"
|
||||
|
||||
@@ -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 FirPluginOracleServiceFE10Impl : FirPluginOracleService() {
|
||||
override fun isFirPlugin(): Boolean = false
|
||||
}
|
||||
Reference in New Issue
Block a user