### Install Dependencies Source: https://github.com/kotlin/kotlin-lsp/blob/main/kotlin-vscode/DEVELOPMENT.md Installs the necessary project dependencies using pnpm. ```sh pnpm install ``` -------------------------------- ### Configure Kotlin LSP via stdio Source: https://github.com/kotlin/kotlin-lsp/blob/main/scripts/neovim.md Configure Neovim's LSP client to use the Kotlin LSP via stdio. This setup is suitable for single-file support. ```lua { cmd = { "kotlin-ls", "--stdio" }, single_file_support = true, filetypes = { "kotlin" }, root_markers = { "build.gradle", "build.gradle.kts", "pom.xml" }, } ``` -------------------------------- ### Configure Kotlin LSP via TCP Source: https://github.com/kotlin/kotlin-lsp/blob/main/scripts/neovim.md Configure Neovim's LSP client to connect to a running Kotlin LSP instance listening on TCP port 9999. This setup is suitable for single-file support. ```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" }, } ``` -------------------------------- ### Enable and Configure Kotlin LSP with nvim-lspconfig Source: https://github.com/kotlin/kotlin-lsp/blob/main/scripts/neovim.md Use this snippet to enable the Kotlin language server and set its options when using the `nvim-lspconfig` plugin. ```lua vim.lsp.enable('kotlin_lsp') -- configure language server's options vim.lsp.config('kotlin_lsp', { single_file_support = false, }) ``` -------------------------------- ### Make kotlin-lsp.sh Executable Source: https://github.com/kotlin/kotlin-lsp/blob/main/scripts/neovim.md Ensure the `kotlin-lsp.sh` script has execute permissions before creating a symlink. ```sh chmod +x $KOTLIN_LSP_DIR/kotlin-lsp.sh ``` -------------------------------- ### Create Symlink for kotlin-lsp Source: https://github.com/kotlin/kotlin-lsp/blob/main/scripts/neovim.md Create a symbolic link to the `kotlin-lsp.sh` script in a directory that is on your system's PATH. ```sh ln -s $KOTLIN_LSP_DIR/kotlin-lsp.sh $HOME/.local/bin/kotlin-ls ``` -------------------------------- ### Run Tests Source: https://github.com/kotlin/kotlin-lsp/blob/main/kotlin-vscode/DEVELOPMENT.md Executes the project's test suite using pnpm. ```sh pnpm test ``` -------------------------------- ### build.gradle.kts Configuration Source: https://github.com/kotlin/kotlin-lsp/blob/main/workspace-import/test/testData/gradle/SystemPropertiesCheckerProject/README.md This snippet configures the Gradle build to require specific system properties for LSP integration. It asserts that `idea.sync.active` and `com.jetbrains.ls.imports.gradle` are set to 'true'. ```gradle build.gradle.kts ``` ```kotlin require("idea.sync.active" == "true") require("com.jetbrains.ls.imports.gradle" == "true") ``` -------------------------------- ### Enable and Prepare pnpm for Workspace Source: https://github.com/kotlin/kotlin-lsp/blob/main/kotlin-vscode/DEVELOPMENT.md Enables Corepack and prepares a specific version of pnpm for use within a pnpm workspace. ```sh corepack enable corepack prepare pnpm@11.4.0 --activate ``` -------------------------------- ### Build VSIX Package Source: https://github.com/kotlin/kotlin-lsp/blob/main/kotlin-vscode/DEVELOPMENT.md Builds the VSIX package for the Kotlin Language Server after server artifacts are generated. ```sh ./build.sh ``` -------------------------------- ### Configure Helix for Kotlin LSP Source: https://github.com/kotlin/kotlin-lsp/blob/main/scripts/helix.md Add this configuration to your ~/.config/helix/languages.toml file to enable the kotlin-lsp language server for Kotlin files. ```toml [[language]] name = "kotlin" language-servers = [ "kotlin-lsp" ] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.