vkostyukov / kotlin-sublime-package

Sublime Text 2 Package for Kotlin Programming Language
Apache License 2.0
138 stars 42 forks source link

Interfaces without Blocks break the rest of the file until a Block appears #9

Open phase opened 8 years ago

phase commented 8 years ago

Interfaces don't require a block, but the highlighter won't highlight correctly until it finds a block for the interface.

interface Test

/**
 * Doc Block Comment
 */
val test = 1

/**
 * asdf
 */
val T_UNDEF = object {
    override fun toString() = "undefined type"
}

/**
 * Another Doc Block Comment
 */
val test2 = 2

With an empty block, everything works normally.

interface Test {}

/**
 * Doc Block Comment
 */
val test = 1

/**
 * asdf
 */
val T_UNDEF = object {
    override fun toString() = "undefined type"
}

/**
 * Another Doc Block Comment
 */
val test2 = 2
ilya-g commented 7 years ago

Same thing happens with annotation classes without bodies https://github.com/JetBrains/kotlin/blob/master/libraries/kotlin.test/js/src/main/kotlin/kotlin/test/Annotations.kt