fwcd / vscode-kotlin

Kotlin code completion, debugging, linting and more for VSCode
MIT License
298 stars 41 forks source link

Syntax highlighting doesn't work with nested block comments. #152

Open a-stewart opened 4 months ago

a-stewart commented 4 months ago

Consider the following code:

/* This is a multi-line comment and it can span
 * as many lines as you like 
 /* 
   This is a nested comment
 */
 // Another nested comment
 The comment continues here.
*/

fun main() {
    println("Hello, World!")
}

The closing of the nested comment seems to end the outer comment.

image

Where it can be really confusing is if you include a /* in a comment as you may not realise that you are still in a comment.

Eg in the following code, the main function is commented out:

/*
 * This function will work on the directory /home/user/*
 */
fun main() {
    println("Hello, World!")
}

But it looks completely valid with this extension:

image