nishtahir / language-kotlin

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

Syntax Highlighting Issue #5

Closed gantonious closed 5 years ago

gantonious commented 5 years ago

I haven't had enough time to look into the exact issue but I noticed earlier today that Kotlin syntax highlighting isn't working as expected. See the following sample file in linguist: https://github.com/github/linguist/blob/master/samples/Kotlin/Foo.kt

It looks like linguist just had a release earlier today and I think that's when it broke. See https://github.com/github/linguist/pull/4324.

Grohden commented 5 years ago

It's happening here too

https://github.com/levibostian/Wendy-Android/blob/b93f22b7da53250cb1e78bbbe09129378af0109e/wendy/src/main/java/com/levibostian/wendy/WendyConfig.kt#L89

gantonious commented 5 years ago

Just a quick follow up from yesterday. I quickly spun up a VSCode language extension using the same syntax currently being used by linguist and it seems to be working fine in VSCode (note I just tested the plist file not the YAML):

image

nishtahir commented 5 years ago

Thanks for reporting this. I started looking into this yesterday and it seems that the bug has something to do with https://github.com/nishtahir/language-kotlin/blob/7631a679e35ba0cd55aadd27ce850f5874894607/syntax/Kotlin.tmLanguage#L809 which was to allow for generics in types.

It looks like VSCode and GitHub treat these very differently. After removing it and testing it with lightshow. It seems to work correctly.

I've pushed a fix for it in 69733ef5d051407c42b9a5ccdd4e5822a419264e

Zhuinden commented 5 years ago

Is this fix out and available? I'm asking because PRs that I'm reviewing still show up with pretty much all the code ending up in a blue-ish (purple) tint.

gantonious commented 5 years ago

It should be out when github/lingust does another release. See: https://github.com/github/linguist/issues/4329

lildude commented 5 years ago

GitHub should now be rendering Kotlin files correctly again.

nishtahir commented 5 years ago

Thanks, @lildude!