kotlin-lsp

Project Url: Kotlin/kotlin-lsp
Introduction: Kotlin Language Server and plugin for Visual Studio Code
More: Author   ReportBugs   
Tags:

Kotlin Alpha JetBrains official project GitHub license GitHub Release

VS Code Extension

Official Kotlin support for Visual Studio Code and an implementation of the Language Server Protocol for the Kotlin language.

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

VS Code Quick Start

For the latest release from the official VS Code Marketplace:

  • Install the extension
  • The extension is automatically activated when opening a Kotlin file in a workspace

For manually downloaded builds from the release page:

  1. Download the required VSIX file from the corresponding release page
  2. Install it as a VSC Extension via Extensions | More Actions | Install from VSIX
    • Alternatively, it is possible to drag-and-drop VSIX extension directly into the Extensions tool window

[!WARNING] "Kotlin by JetBrains" extension now has a different VS Code Marketplace ID:

Old one: jetbrains.kotlin

New one: jetbrains.kotlin-server

When you install a newer jetbrains.kotlin-server, a dialog will offer to uninstall an older jetbrains.kotlin extensions.

Example of the dialog. image

Accept it and reload the window — the new extension cannot properly activate while the old jetbrains.kotlin extension is present.

Install kotlin-lsp CLI

For Homebrew users: brew install JetBrains/utils/kotlin-lsp

Manual installation:

  1. Download the standalone zip from the Releases Page
  2. Unpack the ZIP file
  3. chmod +x $KOTLIN_LSP_DIR/kotlin-lsp.sh
  4. Create a symlink on your $PATH ln -s $KOTLIN_LSP_DIR/kotlin-lsp.sh $HOME/.local/bin/kotlin-lsp

Supported Features

  • Up-to-date Kotlin language versions support
  • IntelliJ-powered code completion
  • IntelliJ-powered diagnostics and quick fixes for Kotlin and kotlinx libraries
  • Build system support: Gradle, Maven, experimental AGP support
  • Semantic highlighting
  • Organize imports
  • Rename refactoring
  • Code formatting
  • Documentation navigation and hover support
  • Call Hierarchy
  • Code Folding

Project Status

⚠️ The project is currently in the Alpha state ⚠️

The language server is based on the most recent IntelliJ IDEA version and proprietary parts of JetBrains Air and Fleet products, making it partially closed-source.

Its core implementation details and general architecture are mostly settled and stable. Upcoming releases will focus on feature completeness and stability of the existing functionality.

Supported editors

kotlin-server is designed to work with any editor that supports LSP. Releases are generally tested with Visual Studio Code and there is a community-maintained list of scripts for other editors in the scripts folder. See also ./kotlin-lsp.sh --help for available options.

Feedback and issues

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

Currently, direct contributions are not supported as this repository is a read-only mirror, but it is possible to open a PR for documentation changes, and it will be integrated manually by maintainers.

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools
AI Daily Digest