Kotlin language support for Zed.
The Kotlin Language Server is an unofficial LSP for Kotlin, it is currently the most stable and popular language server for Kotlin. It is enabled by default by this extension.
Workspace configuration options can be passed to the language server via lsp
settings in settings.json
.
The following example changes the JVM target from default
(which is 1.8) to
17
:
{
"lsp": {
"kotlin-language-server": {
"settings": {
"compiler": {
"jvm": {
"target": "17"
}
}
}
}
}
}
The full list of workspace configuration options can be found here.
Kotlin LSP is an official LSP implementation for Kotlin, built by JetBrains. It is currently pre-alpha.
To use Kotlin LSP instead of the Kotlin Language Server, you must explicity enable it in your settings.json
:
{
"languages": {
"kotlin": {
"language_servers": ["kotlin-lsp"]
}
}
}
It will be downloaded and updated automatically when enabled, however, you can use a manually installed version by setting the path to the kotlin-lsp.sh
script in the release assets:
{
"lsp": {
"kotlin-lsp": {
"binary": {
"path": "path/to/kotlin-lsp.sh",
"arguments": [ "--stdio" ]
}
}
}
}
Note that the kotlin-lsp.sh
script expects to be run from within the unzipped release zip file, and should not be moved elsewhere.