fork-dev / Tracker

Bug and issue tracker for Fork for Mac
512 stars 12 forks source link

Kotlin Syntax highlighting #2222

Open abentele opened 4 weeks ago

abentele commented 4 weeks ago

assume this valid Kotlin Unit test class:

import org.junit.jupiter.api.Test

class Test {

    @Test
    fun `test if Kotlin syntax highlighting doesn't stop at this point`() {
        println("this is valid Kotlin code but not highlighted as expected in git fork")
    }
}

While I normally don't use this style of method name, in unit tests I've used to use them heavily, to be able to describe the test in a more natural way.

I've used an apostrophe in the method name ("doesn't"), which is allowed in Kotlin.

The syntax highlighting in the details view is not correct, as you can see in the screenshot:

screenshot

This bug applies to git fork Version 2.46.2 on macOS 15.0.1.

By the way: the "if" in the method name is rendered like it would be a keyword, but is not in this context.

The main problem is that everything in the file below this apostrophe is highlighted in blue, i.e. the syntax highlighting is broken for everything below.

abentele commented 4 weeks ago

btw: I observed similar problems in Typesscript/React (tsx) files. If wanted, I can feed you with details via another issue.