From febfeb9021a7652bf92a343ce8238b6e13837369 Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Fri, 20 Jun 2025 17:15:00 +0200 Subject: [PATCH 1/3] kotlin-ls -> kotlin-lsp Yes, I know that lsp stands for "language server protocol", and thus what we create should be called just plain "language server" But LSP abbreviation is ubiquitous and self-explanatory. It's clear what "kotlin-lsp" means, and it's not so much clear what does kotlin-ls mean. Additional arguments: - This git repo is already called kotlin-lsp - The official nvim lsp integration calls it `kotlin-lsp` https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#kotlin_lsp - The script is called `kotlin-lsp.sh` --- scripts/neovim.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/neovim.md b/scripts/neovim.md index 2a92104..25bf24d 100644 --- a/scripts/neovim.md +++ b/scripts/neovim.md @@ -13,13 +13,13 @@ 3. Create a symlink inside your `PATH` to `kotlin-lsp.sh` script, e.g.: ```sh - ln -s $KOTLIN_LSP_DIR/kotlin-lsp.sh $HOME/.local/bin/kotlin-ls + ln -s $KOTLIN_LSP_DIR/kotlin-lsp.sh $HOME/.local/bin/kotlin-lsp ``` 4. Configure [nvim.lsp](https://neovim.io/doc/user/lsp.html) e.g: ```lua { - cmd = { "kotlin-ls", "--stdio" }, + cmd = { "kotlin-lsp", "--stdio" }, single_file_support = true, filetypes = { "kotlin" }, root_markers = { "build.gradle", "build.gradle.kts", "pom.xml" }, From c3e61875c1be35fcc2835c73136a0b021219af26 Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Fri, 20 Jun 2025 17:24:46 +0200 Subject: [PATCH 2/3] Add kotlin-lsp CLI installation instruction to README --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d4a699..c8f00b6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ for the Kotlin language. The server is based on [IntelliJ IDEA](https://github.com/JetBrains/intellij-community) and the [IntelliJ IDEA Kotlin Plugin](https://github.com/JetBrains/intellij-community/tree/master/plugins/kotlin) implementation. -### Quick Start +### VS Code Quick Start 1. Download the latest build of VSC extension or Standalone version from the [Releases Page](https://github.com/Kotlin/kotlin-lsp/releases) 2. Install it as a VSC Extension via `Extensions | More Action | Install from VSIX` @@ -21,6 +21,16 @@ implementation. ![quickstart_sample.gif](images/quickstart_sample.gif) +### Install kotlin-lsp CLI + +For brew users: `brew install JetBrains/utils/kotlin-lsp` + +Manual installation: +1. Download the standalone zip from the [Releases Page](https://github.com/Kotlin/kotlin-lsp/releases) +2. Unpack zip +3. `chmod +x $KOTLIN_LSP_DIR/kotlin-lsp.sh` +4. Create a symlink inside your PATH `ln -s $KOTLIN_LSP_DIR/kotlin-lsp.sh $HOME/.local/bin/kotlin-lsp` + ### 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: From a58c42452e660f03836c047931b837061cef3039 Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Fri, 20 Jun 2025 17:30:25 +0200 Subject: [PATCH 3/3] Simplify Neovim installation instruction Users don't have to interact with low-level `nvim.lsp` API anymore, they can use the official `nvim-lspconfig` I'd love to merge neovim.md directly into the README, but given these lines: > 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. I don't dare to do so --- scripts/neovim.md | 47 ++++------------------------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/scripts/neovim.md b/scripts/neovim.md index 25bf24d..91e92b4 100644 --- a/scripts/neovim.md +++ b/scripts/neovim.md @@ -1,44 +1,5 @@ -# neovim setup +# Neovim setup -## stdio way - -1. Ensure socat and netcat are installed - -2. Ensure `kotlin-lsp.sh` is executable - - ```sh - chmod +x $KOTLIN_LSP_DIR/kotlin-lsp.sh - ``` - -3. Create a symlink inside your `PATH` to `kotlin-lsp.sh` script, e.g.: - - ```sh - ln -s $KOTLIN_LSP_DIR/kotlin-lsp.sh $HOME/.local/bin/kotlin-lsp - ``` - -4. Configure [nvim.lsp](https://neovim.io/doc/user/lsp.html) e.g: - ```lua - { - cmd = { "kotlin-lsp", "--stdio" }, - single_file_support = true, - filetypes = { "kotlin" }, - root_markers = { "build.gradle", "build.gradle.kts", "pom.xml" }, - } - ``` - -## tcp way - -Requires manual launch of language server - -1. launch language server with `kotlin-lsp.sh` script - -2. Configure [nvim.lsp](https://neovim.io/doc/user/lsp.html) e.g: - ```lua - { - cmd = vim.lsp.rpc.connect('127.0.0.1', tonumber(9999)), - single_file_support = true, - filetypes = { "kotlin" }, - root_markers = { "build.gradle", "build.gradle.kts", "pom.xml" }, - } - ``` - +1. [Install `kotlin-lsp` CLI](../README.md#install-kotlin-lsp-cli) +2. Install the official Neovim [`nvim-lspconfig` plugin](https://github.com/neovim/nvim-lspconfig) +3. Enable the LSP `vim.lsp.enable('kotlin_lsp')` in your `init.lua`