fwcd / fwcd/vscode-kotlin

Syntax highlighting doesn't work with nested block comments.

Open
#152 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
359
Forks
56
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Kotlin syntax-highlighting grammar used by the VSCode extension and reproduce the two examples in a local VSCode window. Update the grammar so nested block comments and comment text containing /* remain highlighted correctly, then verify both examples no longer make code appear active inside a comment.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.