Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Editors and IDEs

Status: ⚪ Planned — kargo metadata and kargo lsp are not implemented. This page describes the intended integration. See Implementation Status.

Kargo projects are meant to work in your editor without that editor knowing anything about Kargo. Two pieces make that possible: a machine-readable project model, and a language server.

kargo metadata

kargo metadata --format json

One JSON document describing the fully resolved project:

{
  "package": { "name": "my-app", "version": "1.2.0", "kotlin": "2.4.21" },
  "targets": [
    {
      "name": "jvm",
      "javaTarget": "25",
      "sourceSets": [
        { "name": "commonMain", "kotlin": ["src/commonMain/kotlin"] },
        { "name": "jvmMain", "kotlin": ["src/jvmMain/kotlin"], "dependsOn": ["commonMain"] }
      ],
      "classpath": [
        "~/.kargo/cache/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.8.0/kotlinx-coroutines-core-1.8.0.jar"
      ],
      "compilerArgs": ["-jvm-target", "25"]
    }
  ],
  "variants": ["free-staging-dev", "paid-production-release"],
  "buildDir": "build"
}

Everything an editor needs — source roots, classpath JARs, compiler arguments, the source-set graph — without reimplementing resolution. This is also the contract subcommand plugins use, which keeps one format honest instead of two.

kargo metadata --format json | jq -r '.targets[].classpath[]'

Language server

kargo lsp

An LSP server providing:

  • diagnostics from kargo check, as you type
  • lint warnings inline, with auto-fixes as code actions
  • completion and validation inside Kargo.toml, including dependency coordinates
  • jump-to-definition across source sets, respecting expect/actual

Any LSP-capable editor can drive it. For Kotlin code intelligence itself, the intent is to delegate to the Kotlin language server rather than reimplement it — Kargo's job is to tell it the right classpath and source roots.

IntelliJ IDEA and Android Studio

Status: ⚪ Planned — a plugin consuming kargo metadata.

The goal is opening a Kargo project with full code intelligence and no Gradle import step. kargo metadata exists precisely so a plugin can map the project model onto IntelliJ's module system without duplicating resolution logic.

Until then, the practical workaround is a minimal Gradle or Maven file that declares the same dependencies for the IDE's benefit while Kargo does the real builds. It is not elegant, and it is the honest state of things today.

VS Code

Status: ⚪ Planned.

An extension wrapping kargo lsp, plus tasks for build, test, and run, and Kargo.toml completion.

Today, .vscode/tasks.json gets you most of the way:

{
  "version": "2.0.0",
  "tasks": [
    { "label": "kargo build", "type": "shell", "command": "kargo build", "group": "build" },
    { "label": "kargo test", "type": "shell", "command": "kargo test", "group": "test" },
    { "label": "kargo check", "type": "shell", "command": "kargo check" }
  ]
}

Editor-agnostic workflow that works now

kargo watch --build-only    # continuous compilation in a terminal
kargo check                 # bind to a keystroke
kargo test --filter MyTest  # run one test

Not as good as inline diagnostics, but fast — a native binary with no daemon gives useful feedback on check well before an IDE would finish importing.

Next