Add internal action to toggle analysis mode
^KT-32562 Fixed
This commit is contained in:
@@ -149,6 +149,9 @@
|
|||||||
<action id="StoredExceptionsThrowToggleAction" class="org.jetbrains.kotlin.idea.actions.internal.StoredExceptionsThrowToggleAction"
|
<action id="StoredExceptionsThrowToggleAction" class="org.jetbrains.kotlin.idea.actions.internal.StoredExceptionsThrowToggleAction"
|
||||||
text="Throw cached PCE"/>
|
text="Throw cached PCE"/>
|
||||||
|
|
||||||
|
<action id="MultiplatformCompositeAnalysisToggleAction" class="org.jetbrains.kotlin.idea.actions.internal.MultiplatformCompositeAnalysisToggleAction"
|
||||||
|
text="Toggle Composite Analysis"/>
|
||||||
|
|
||||||
<action id="CopyAsDiagnosticTest" class="org.jetbrains.kotlin.idea.actions.internal.CopyAsDiagnosticTestAction"
|
<action id="CopyAsDiagnosticTest" class="org.jetbrains.kotlin.idea.actions.internal.CopyAsDiagnosticTestAction"
|
||||||
text="Copy Current File As Diagnostic Test"/>
|
text="Copy Current File As Diagnostic Test"/>
|
||||||
|
|
||||||
|
|||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2019 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.actions.internal
|
||||||
|
|
||||||
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
|
import com.intellij.openapi.actionSystem.ToggleAction
|
||||||
|
import org.jetbrains.kotlin.idea.project.KotlinMultiplatformAnalysisModeComponent
|
||||||
|
import org.jetbrains.kotlin.idea.project.KotlinMultiplatformAnalysisModeComponent.Mode
|
||||||
|
import org.jetbrains.kotlin.idea.project.useCompositeAnalysis
|
||||||
|
|
||||||
|
class MultiplatformCompositeAnalysisToggleAction :
|
||||||
|
ToggleAction("Toggle composite analysis mode for multiplatform", "Analyse modules with different platforms together", null) {
|
||||||
|
|
||||||
|
override fun isSelected(e: AnActionEvent): Boolean = e.project?.useCompositeAnalysis == true
|
||||||
|
|
||||||
|
override fun setSelected(e: AnActionEvent, state: Boolean) {
|
||||||
|
KotlinMultiplatformAnalysisModeComponent.setMode(
|
||||||
|
e.project ?: return,
|
||||||
|
if (state) Mode.COMPOSITE else Mode.SEPARATE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user