## Summary - The default settings in `assets/settings/default.json` disable `kotlin-language-server` (prefixed with `!`) and enable `kotlin-lsp` as the primary LSP, but the Kotlin documentation listed them the other way around. This swaps the order so the docs match reality. ## Test plan - [x] Verified `assets/settings/default.json` has `["!kotlin-language-server", "kotlin-lsp", "..."]` for Kotlin - [x] Confirmed the documentation now lists `kotlin-lsp` as the primary Language Server and `kotlin-language-server` as the alternate Release Notes: - N/A --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2.6 KiB
title, description
| title | description |
|---|---|
| Kotlin | Configure Kotlin language support in Zed, including language servers, formatting, and debugging. |
Kotlin
Kotlin language support in Zed is provided by the community-maintained Kotlin extension. Report issues to: https://github.com/zed-extensions/kotlin/issues
- Tree-sitter: fwcd/tree-sitter-kotlin
- Language Server: kotlin/kotlin-lsp
- Alternate Language Server: fwcd/kotlin-language-server
Kotlin LSP
Kotlin LSP is the official language server for Kotlin, built by JetBrains. It is used by default.
It is downloaded and updated automatically. If you want to use a manually installed version instead, set the path to the kotlin-lsp.sh script from the release assets in your settings.json:
{
"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.
Kotlin Language Server
The community-maintained Kotlin Language Server can be used instead of Kotlin LSP by explicitly enabling it in your settings.json:
{
"languages": {
"Kotlin": {
"language_servers": ["kotlin-language-server", "!kotlin-lsp", "..."]
}
}
}
Configuration
Workspace configuration options can be passed to the language server via lsp
settings in settings.json.
The full list of lsp settings can be found
here
under class Configuration and initialization_options under class InitializationOptions.
JVM Target
The following example changes the JVM target from default (which is 1.8) to
17:
{
"lsp": {
"kotlin-language-server": {
"settings": {
"compiler": {
"jvm": {
"target": "17"
}
}
}
}
}
}
JAVA_HOME
To use a specific java installation, just specify the JAVA_HOME environment variable with:
{
"lsp": {
"kotlin-language-server": {
"binary": {
"env": {
"JAVA_HOME": "/Users/whatever/Applications/Work/Android Studio.app/Contents/jbr/Contents/Home"
}
}
}
}
}