Skip to content

zed-extensions/kotlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zed-kotlin

Kotlin language support for Zed.

Language Servers

Kotlin Language Server

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.

Configuration

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

Kotlin LSP is an official LSP implementation for Kotlin, built by JetBrains. It is currently pre-alpha.

Configuration

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.

About

Kotlin support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 9