feat: Add kotlin lsp integration#6601
Merged
rekram1-node merged 5 commits intoanomalyco:devfrom Jan 2, 2026
Merged
Conversation
Collaborator
|
/review |
rekram1-node
reviewed
Jan 2, 2026
JBou
reviewed
Jan 2, 2026
| export const KotlinLS: Info = { | ||
| id: "kotlin-ls", | ||
| extensions: [".kt", ".kts"], | ||
| root: NearestRoot(["build.gradle", "build.gradle.kts", "settings.gradle.kts", "pom.xml"]), |
Contributor
There was a problem hiding this comment.
Hello, thanks for your work on this. I am really looking forward to it!
But in my opinion, this currently doesn't correctly support multi-project structures, as it would detect a subproject/module as root.
I would suggest:
root: (start) =>
// 1) Nearest Gradle root (multi-project or included build)
NearestRoot(["settings.gradle.kts", "settings.gradle"])(start) ??
// 2) Gradle wrapper (strong root signal)
NearestRoot(["gradlew", "gradlew.bat"])(start) ??
// 3) Single-project or module-level build
NearestRoot(["build.gradle.kts", "build.gradle"])(start) ??
// 4) Maven fallback
NearestRoot(["pom.xml"])(start),
Collaborator
There was a problem hiding this comment.
good catch that should be fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for the Kotlin language server to the OpenCode LSP infrastructure. The main changes include updating language extension mappings and introducing logic to automatically download, install, and launch the Kotlin Language Server when needed.
Kotlin Language Server Integration
.ktand.ktsfile extensions to theLANGUAGE_EXTENSIONSmapping, associating them with the Kotlin language.KotlinLSentry inLSPServer, which detects the project root, checks for a local server installation, and downloads/releases the latest Kotlin Language Server from GitHub if not present. The implementation also handles platform and architecture compatibility, extraction, and launching of the server process.