Skip to content

feat: Kotlin Build System (Kotlin Toolchain / Amper) support — would a PR be welcome? #316

Description

@AQMpolyface

Hi — I use kmp-lsp on a Kotlin Build System project (the Kotlin Toolchain CLI, Amper's successor: project.yaml + module.yaml, flat src / src@<target> / test / test@<target> layout). I actually prefer it over Gradle these days — the CLI is way friendlier to work with — but hit gaps that made hover and completion unusable there. I built support in a fork and wanted to check before opening anything upstream.

What it covers

  • Source roots from project.yaml's modules: list and the flat KBS layout; test / test@<target> classification; project.yaml / module.yaml workspace-root markers; .kotlin excluded; KBS projects nested inside a monorepo.
  • Dependency indexing from the Kotlin Toolchain's own maven cache (~/.cache/JetBrains/Kotlin/.m2.cache), deduplicated against the Gradle cache.
  • Android parity: android.jar and the SDK sources via the local.properties KBS generates, plus each module's R.jar from its internal Gradle build.
  • A prerequisite LSP fix: internal source roots were being classified as Library, which silently skipped the jar pipeline and double-indexed files on Gradle projects too — plus a star-import fix (import androidx.compose.material3.* was skipped, so those symbols never resolved).

cargo test (1982 tests) and clippy are clean. Verified live on a real project: hover resolves MaterialTheme, Column, android.os.Bundle, and friends.

Fork: https://github.com/AQMpolyface/kmp-lsp (main). It's 5 commits — one is an independent fix — and I'm happy to split it into smaller PRs or adapt to your conventions.

Note: developed with AI assistance (OpenCode). Happy to note that in a PR, or to skip the contribution if you'd rather not take AI-assisted work or do not want to support Amper.

Would you be open to this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions