Line Markers: Don't show test run line markers for top-level functions
#KT-13509 Fixed
This commit is contained in:
@@ -142,6 +142,8 @@ class KotlinTestRunLineMarkerContributor : RunLineMarkerContributor() {
|
|||||||
|
|
||||||
if (declaration !is KtClassOrObject && declaration !is KtNamedFunction) return null
|
if (declaration !is KtClassOrObject && declaration !is KtNamedFunction) return null
|
||||||
|
|
||||||
|
if (declaration is KtNamedFunction && declaration.containingClassOrObject == null) return null
|
||||||
|
|
||||||
// To prevent IDEA failing on red code
|
// To prevent IDEA failing on red code
|
||||||
val descriptor = declaration.resolveToDescriptorIfAny() ?: return null
|
val descriptor = declaration.resolveToDescriptorIfAny() ?: return null
|
||||||
|
|
||||||
|
|||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
// !CHECK_HIGHLIGHTING
|
||||||
|
|
||||||
|
package kotlin.test
|
||||||
|
|
||||||
|
annotation class Test
|
||||||
|
annotation class Ignore
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import kotlin.test.*
|
||||||
|
|
||||||
|
@Test fun testFoo() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Ignore fun testFooWrong() {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -110,6 +110,10 @@ class MultiModuleLineMarkerTest : AbstractMultiModuleHighlightingTest() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun testTopLevelFunWithKotlinTest() {
|
||||||
|
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
|
||||||
|
}
|
||||||
|
|
||||||
fun testSuspendImplInPlatformModules() {
|
fun testSuspendImplInPlatformModules() {
|
||||||
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], TargetPlatformKind.JavaScript)
|
doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], TargetPlatformKind.JavaScript)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user