nishtahir / language-kotlin

Textmate language grammar for the Kotlin programming language
Apache License 2.0
12 stars 6 forks source link

data is highlighted as a class modifier in different scenarios #50

Closed starsep closed 3 years ago

starsep commented 3 years ago

It seems that data is always highlighted as a class modifier i.e. as in data class.

fun foo(data: String) {}
val data = "42"
foo(data = data)

data class Klass(val data: Int)
Klass(data = 42)
Animeshz commented 3 years ago

Same goes for keywords like

val expect: String
val actual: Int
val vararg: List<Int>

We can add a positive lookahead on the soft keywords to fix this. https://github.com/nishtahir/language-kotlin/blob/5738095b675a42b520b40b673ba2ea52f50cd91c/src/keywords.YAML-tmLanguage#L23