-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Better Kotlin syntax #3698
Copy link
Copy link
Closed
Labels
feature-requestNew feature or requestNew feature or requestsyntax-highlightingsyntax-requestsyntax-request-approvedPRs adding the syntax as a git submodule along with some highlighting tests will be approvedPRs adding the syntax as a git submodule along with some highlighting tests will be approved
Metadata
Metadata
Assignees
Labels
feature-requestNew feature or requestNew feature or requestsyntax-highlightingsyntax-requestsyntax-request-approvedPRs adding the syntax as a git submodule along with some highlighting tests will be approvedPRs adding the syntax as a git submodule along with some highlighting tests will be approved
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.