Default to plain 'Run' icon when calculating icons for common code
#KT-26942 Fixed
This commit is contained in:
+7
-3
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.core.platform.impl
|
package org.jetbrains.kotlin.idea.core.platform.impl
|
||||||
|
|
||||||
|
import com.intellij.icons.AllIcons
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.openapi.roots.libraries.Library
|
import com.intellij.openapi.roots.libraries.Library
|
||||||
import org.jetbrains.kotlin.analyzer.common.CommonAnalyzerFacade
|
import org.jetbrains.kotlin.analyzer.common.CommonAnalyzerFacade
|
||||||
@@ -47,12 +48,15 @@ object CommonIdePlatformKindTooling : IdePlatformKindTooling() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getTestIcon(declaration: KtNamedDeclaration, descriptor: DeclarationDescriptor): Icon? {
|
override fun getTestIcon(declaration: KtNamedDeclaration, descriptor: DeclarationDescriptor): Icon? {
|
||||||
return IdePlatformKindTooling.getInstances()
|
val icons = IdePlatformKindTooling.getInstances()
|
||||||
.asSequence()
|
|
||||||
.filter { it != this }
|
.filter { it != this }
|
||||||
.mapNotNull { it.getTestIcon(declaration, descriptor) }
|
.mapNotNull { it.getTestIcon(declaration, descriptor) }
|
||||||
.distinct()
|
.distinct()
|
||||||
.singleOrNull()
|
|
||||||
|
return when (icons.size) {
|
||||||
|
0 -> null
|
||||||
|
else -> icons.singleOrNull() ?: AllIcons.RunConfigurations.TestState.Run
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun acceptsAsEntryPoint(function: KtFunction): Boolean {
|
override fun acceptsAsEntryPoint(function: KtFunction): Boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user