zed-extensions / kotlin

Syntax highlighting for Kotlin in Zed.
MIT License
23 stars 10 forks source link

feat: recognise .kts as Kotlin files #9

Closed fdionisi closed 6 months ago

fdionisi commented 6 months ago

This PR enables Kotlin syntax highlight for .kts files which - for my understanding - uses the same language but are meant for scripting purposes.

A clear use case are various *.gradle.kts in Gradle projects.

cholwell commented 6 months ago

@fdionisi I originally included .kts files when adding the LSP but encountered issues saving.

On saving a .kts file all changes would be reverted so please test this before adding.

fdionisi commented 6 months ago

Hey @cholwell, thank you for pointing out this issue which I completely overseen. When testing this addition I noticed auto formatting upon save, but didn't realise the file would revert to a previous state. That's really annoying.

I'll close this PR, to reduce the noise - unfortunately, I'm unsure when I'll be able to debug this further.

It may be beneficial noting this problem as a known issue somewhere in this repository, so that people won't naïvely make my same mistake, and avoid bothering maintainers; knowledge is power.