Update to 142.4245.2: Update Kotlin run line marker info to new API
This commit is contained in:
@@ -403,9 +403,11 @@
|
||||
<configurationType implementation="org.jetbrains.kotlin.idea.k2jsrun.K2JSRunConfigurationType"/>
|
||||
<programRunner implementation="org.jetbrains.kotlin.idea.k2jsrun.K2JSBrowserProgramRunner"/>
|
||||
<runConfigurationProducer implementation="org.jetbrains.kotlin.idea.run.KotlinRunConfigurationProducer"/>
|
||||
|
||||
<codeInsight.lineMarkerProvider language="jet" implementationClass="org.jetbrains.kotlin.idea.highlighter.markers.KotlinLineMarkerProvider"/>
|
||||
<codeInsight.lineMarkerProvider language="jet" implementationClass="org.jetbrains.kotlin.idea.highlighter.KotlinRecursiveCallLineMarkerProvider"/>
|
||||
<codeInsight.lineMarkerProvider language="jet" implementationClass="org.jetbrains.kotlin.idea.highlighter.KotlinRunLineMarkerProvider"/>
|
||||
<runLineMarkerContributor language="jet" implementationClass="org.jetbrains.kotlin.idea.highlighter.KotlinRunLineMarkerContributor"/>
|
||||
|
||||
<iconProvider implementation="org.jetbrains.kotlin.idea.JetIconProvider"/>
|
||||
<itemPresentationProvider implementationClass="org.jetbrains.kotlin.idea.presentation.JetFunctionPresenter"
|
||||
forClass="org.jetbrains.kotlin.psi.JetFunction"/>
|
||||
|
||||
+7
-12
@@ -16,9 +16,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.highlighter
|
||||
|
||||
import com.intellij.codeInsight.daemon.LineMarkerInfo
|
||||
import com.intellij.codeInsight.daemon.LineMarkerProvider
|
||||
import com.intellij.execution.lineMarker.RunLineMarkerInfo
|
||||
import com.intellij.execution.lineMarker.ExecutorAction
|
||||
import com.intellij.execution.lineMarker.RunLineMarkerContributor
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.idea.JetIcons
|
||||
@@ -27,25 +26,21 @@ import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptor
|
||||
import org.jetbrains.kotlin.psi.JetNamedFunction
|
||||
|
||||
|
||||
public class KotlinRunLineMarkerProvider : LineMarkerProvider {
|
||||
override fun getLineMarkerInfo(e: PsiElement): LineMarkerInfo<PsiElement>? {
|
||||
val function = e.parent as? JetNamedFunction
|
||||
public class KotlinRunLineMarkerContributor : RunLineMarkerContributor() {
|
||||
override fun getInfo(element: PsiElement?): RunLineMarkerContributor.Info? {
|
||||
val function = element?.parent as? JetNamedFunction
|
||||
if (function == null) return null
|
||||
|
||||
if (function.nameIdentifier != e) return null
|
||||
if (function.nameIdentifier != element) return null
|
||||
|
||||
val detector = MainFunctionDetector { function ->
|
||||
function.resolveToDescriptor() as FunctionDescriptor
|
||||
}
|
||||
|
||||
if (detector.isMain(function)) {
|
||||
return RunLineMarkerInfo(function, JetIcons.LAUNCH, null)
|
||||
return RunLineMarkerContributor.Info(JetIcons.LAUNCH, null, ExecutorAction.ACTIONS)
|
||||
}
|
||||
|
||||
return null
|
||||
|
||||
}
|
||||
|
||||
override fun collectSlowLineMarkers(elements: List<PsiElement>, result: MutableCollection<LineMarkerInfo<PsiElement>>) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user