Kotlin/kotlin-lsp: Kotlin Language Server and plugin for Visual Studio Code


Kotlin Alpha
JetBrains incubator project

Pre-alpha official Kotlin support for Visual Studio Code and an implementation of Language Server Protocol
for the Kotlin language.

The server is based on IntelliJ IDEA and the IntelliJ IDEA Kotlin Plugin
implementation.

  1. Download the latest build of VSC extension via RELEASES.md
  2. Install it as a VSC Extension via Extensions | More Action | Install from VSIX
    • Alternatively, it is possible to drag-and-drop VSIX extension directly into Extensions tool window
  3. Ensure that your Java version is 17 or above
  4. Open a folder with JVM-only Kotlin Gradle project and the project will be immediately recognized and LSP activated

quickstart_sample.gif

Supported features and Roadmap

The best way to track current capabilities and what is going to be supported in the next builds is this table:

Important note: currently, only JVM-only Kotlin Gradle projects are supported out-of-the box.

The project is in an experimental, pre-alpha, exploratory phase with the intention to be productionized.

We move fast, break things, and explore various aspects of the seamless developer experience
including Java interoperability, limits of IntelliJ capabilities as a standalone server, native binaries of the LSP, and
debug capabilities.

The LSP supports most of the essential parts, but its final shape is not near to be defined and
even the most basic and core parts are being changed on a regular basis.

So we have the corresponding stability guarantees — none. It is okay to use it in your toy
projects, to experiment with it and to provide your feedback, but it is not recommended
to depend on its stability in your day-to-day work.

In the current state, the golden path has been tested for Visual Studio Code with macOS and Linux platforms.

You can use Kotlin LSP with other LSP-compliant editors, but configuration must be done manually.
Please note that Kotlin LSP uses pull-based diagnostics, so the editor must support that.

You can find a standalone LSP launch script in kotlin-lsp.sh along
with very experimental (aka “works on someone’s machine”) instructions that setup LSP for other editors in scripts folder.
See ./kotlin-lsp.sh --help for available options.

Currently, the LSP implementation is partially closed-source, primarily for the sake of development speed convenience —
it heavily depends on parts of IntelliJ, Fleet, and our distributed Bazel build that allows us to
iterate quickly and experiment much faster, cutting corners and re-using internal infrastructure where it helps.
After the initial stabilization phase and defining the final set of capabilities, we will de-couple the LSP implementation from the internal repository
and build pipelines and open source it completely (with an explicit dependency on IntelliJ), this is a temporary constraint.
VSC extension is mirrored into kotlin-vscode as it does not depend on anything internal.

The best way to provide your feedback or report an issue is to file a bug in GitHub issues.

As a temporary limitation, direct contributions are not supported as this repository is a read-only mirror,
but it is possible to open a PR into the documentation, and it will be integrated manually by maintainers.



Source link