I forked the project on SourceForge, but seems like a lot of work, don't know 
if I will get around to doing it (as I have other projects I'm working on).

I found this:
https://www.scintilla.org/Lexer.txt

Basically, you would need to copy this file as LexKotlin.cxx:
https://github.com/geany/geany/blob/master/scintilla/lexers/LexCPP.cxx
https://sourceforge.net/p/scintilla/code/ci/default/tree/lexers/LexCPP.cxx

Then add the new keywords and syntax that Kotlin has, such as `object` 
(lower-case), `data class`, `sealed class`, `fun`, `then`, etc. I think you'd 
probably also want to remove parsing of the ternary operator `a ? b : c` and 
add parsing for the elvis operator `a ?: b`.

You can also look at this project that is adding the Rust language:
https://sourceforge.net/u/dobkeratops/scintilla/ci/default/tree/

Here are other open source projects that have added Kotlin support for help as 
well:
https://github.com/vkostyukov/kotlin-sublime-package
https://github.com/nishtahir/language-kotlin

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/1581#issuecomment-405182480

Reply via email to