Improve expect / actual markers on one line

Before this commit, only one-line enums and annotation classes were
considered. Now we can have enum header on one line and
some entries on another lines, and it still works.
Same with primary constructor parameters.

#KT-22637 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-12-26 16:43:40 +03:00
parent cdef811c55
commit 8de2ff2163
8 changed files with 121 additions and 13 deletions
@@ -0,0 +1,17 @@
package test
expect enum class <lineMarker descr="Has actuals in JVM">Enum</lineMarker> {
<lineMarker descr="Has actuals in JVM">A</lineMarker>, B, C, D
}
/*
LINEMARKER: Has actuals in JVM
TARGETS:
jvm.kt
actual enum class <1>Enum {
*//*
LINEMARKER: Has actuals in JVM
TARGETS:
jvm.kt
<1>A, <2>B, <3>C, <4>D
*/
@@ -0,0 +1,6 @@
// !CHECK_HIGHLIGHTING
package test
actual enum class Enum {
A, B, C, D
}
@@ -0,0 +1,6 @@
// !CHECK_HIGHLIGHTING
expect annotation class Ann(
val x: Int, val y: String,
val z: Double, val b: Boolean
)
@@ -0,0 +1,31 @@
actual annotation class <lineMarker descr="Has declaration in common module">Ann</lineMarker>(
actual val <lineMarker descr="Has declaration in common module">x</lineMarker>: Int, actual val y: String,
actual val <lineMarker descr="Has declaration in common module">z</lineMarker>: Double, actual val b: Boolean
)
// TODO: first marker on 'Ann' is generated twice here, see collectSlowLineMarkers main loop.
// Since it's fragile place, I don't want to fix it right now
/*
LINEMARKER: Has declaration in common module
TARGETS:
common.kt
expect annotation class <1>Ann(
*//*
LINEMARKER: Has declaration in common module
TARGETS:
common.kt
expect annotation class <1>Ann(
*//*
LINEMARKER: Has declaration in common module
TARGETS:
common.kt
val <1>x: Int, val <2>y: String,
*//*
LINEMARKER: Has declaration in common module
TARGETS:
common.kt
val <2>z: Double, val <1>b: Boolean
*/