vscode-kotlin icon indicating copy to clipboard operation
vscode-kotlin copied to clipboard

Syntax highlighting doesn't work with nested block comments.

Open a-stewart opened this issue 7 months ago • 0 comments

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

a-stewart avatar Jul 02 '24 16:07 a-stewart