nishtahir / language-kotlin

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

Kotlin nested multi-line comments syntax-highlighting #20

Closed Apostolique closed 4 years ago

Apostolique commented 4 years ago

Hello, I am trying to highlight nested multi-line comments but it seems like the comment ends on the first closing */.

/*
    This is inside the comment
    /*
        You can insert something here.
    */
    This is a comment since the nested comment is parsed correctly.
*/

Edit: The rule for nested DelimitedComment can be seen here: https://kotlinlang.org/spec/syntax-and-grammar.html#grammar-rule-DelimitedComment.

nishtahir commented 4 years ago

There's a chance this might have been fixed in develop. Specifically here https://github.com/nishtahir/language-kotlin/blob/33fbac0e85e0d451150acd33918bf76f51b4fde3/src/comments.YAML-tmLanguage#L18

nishtahir commented 4 years ago

Just checked that this works correctly in the latest version of the grammar and added a regression test for it in 1fb7337.