An investigation into ⛑️ Kotlin Support in VSCode made me look into how VSCode extensions work, which quickly led me to Language Servers and Debug Adaptors. Luckily, the extensions I was looking at are open-source, which is the perfect way to learn more.

A large part of the complexity within such a language extension is hidden behind the Language Server Protocol and Debug Adaptor Protocol. This makes sense because that way editor features only need a single implementation and each language just needs to translate language concepts to the abstractions.

For more information on how to write a language server in Kotlin or Java, you can have a look at Java bindings for the Language Server Protocol and Debug Adaptor Protocol by Eclipse. The Kotlin Language Server from the Kotlin extension is written in Kotlin using these bindings. Experimental changes are coming to the Kotlin Language Server, which might lead to better support in the future.