Skip to content

Better Kotlin syntax #3698

@guille

Description

@guille

The syntax currently bundled with bat is not great. Any non-trivial Kotlin file has subpar highlighting and in some cases there are scopes that get leaked and the whole file is a mess.

Example: try to use bat on this file: https://github.com/guille/sublime-kotlin/blob/master/examples/test.kt

I was annoyed with this in both Sublime Text and bat so I had GPT-5.4 write one. It has tests and does a better job than the previous one. It is available over in https://github.com/guille/sublime-kotlin with a permissive license, so if you want to switch bat to use it that'd be more than fine.

A comparison of the results: sublimehq/package_control_channel#9391

It doesn't use any of the newer ST syntax features so syntect is able to handle it just fine.

Happy to put up a PR instead if you'd rather review than patch.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions