VS Code Extension

Import, run, test, and debug Elide projects from Visual Studio Code

The Elide extension turns a project with an elide.pkl manifest into a workspace model that the Kotlin LSP by JetBrains imports: source sets become modules, installed Maven dependencies become libraries, and a JDK is selected for symbol resolution. On top of that it contributes Elide build/run/test tasks and JDWP debugging.

Requirements

  • Visual Studio Code 1.105 or newer
  • Elide 1.5 or newer, found via elide.home, $ELIDE_HOME, the platform install locations, or elide on PATH (see Installation)
  • The Kotlin by JetBrains extension (JetBrains.kotlin-server). It is declared as an extension dependency and installs automatically, but its one-time region and data-sharing setup must be completed before the language server starts.
  • A JDK for symbol resolution. Elide’s bundled JDK image cannot serve this role — it ships without a release file, which the importer needs to enumerate modules.

Install the extension

The extension can be downloaded from Elide’s own plugin repository. The link below is version-less and always resolves to the current release:

curl -LOJ "https://plugins.elide.dev/vscode/files?id=elide.elide"
code --install-extension elide-*.vsix

Sync a project

Opening a folder that contains elide.pkl activates the extension and runs a sync:

Every elide.pkl under a workspace folder contributes its source sets to that folder’s single workspace.json. Each source set becomes a module, each jar becomes a library with sibling -sources.jar and -javadoc.jar attached when present, and the manifest’s Kotlin language and API levels plus free compiler arguments are passed through as kotlinc flags.

A status bar item on the left reports and drives sync state; clicking it syncs:

Status bar readsMeaning
Elide, with a checkIn sync
Elide, with a spinnerSyncing
Elide: out of date, warning-coloredelide.pkl changed; click to sync
Elide, error-coloredSync failed; click to retry, or run Elide: Show Output

workspace.json is a generated artifact, add it to .gitignore.

Mixed-editor checkouts

The Kotlin LSP reads workspace.json only when no build system claims the folder first: it matches jps (.idea/modules.xml), gradle, maven, and bazel before falling back to the JSON importer, and prompts when several match. A checked-in .idea would therefore be imported instead of the Elide model. Pinning intellij.buildTool to json in your .vscode/settings.json skips detection, so .idea and workspace.json coexist: IntelliJ ignores workspace.json, VS Code ignores .idea.

Commands

CommandDescription
Elide: Sync Project(s)Re-run the sync.
Elide: Run Elide Command…Pick build, test, install, or run <entrypoint> and run it as a task.
Elide: Open generated Kotlin LSP workspaceOpen workspace.json.
Elide: Show OutputOpen the Elide output channel, which carries CLI output and the sync log.

Tasks

The extension contributes the elide task type, taking command (build, run, test, or install), optional args appended after the command, and project (a project root relative to the workspace folder, for multi-project workspaces).

{ "type": "elide", "command": "test", "args": ["-t", "MyTest"] }

Provided tasks are elide: build, elide: test, elide: install, and one elide: run … per manifest entrypoint (entrypoint, jvm.main, and each scripts key). See Build Tasks for what elide build runs and JVM Testing for how tests execute.

Debug

Launch configuration type elide:

{
  "type": "elide",
  "request": "launch",
  "name": "Elide: Run (debug)",
  "entrypoint": "src/main.kt",
  "args": [],
  "env": {}
}

Every attribute is optional: with no entrypoint, Elide resolves the manifest’s entrypoint or jvm.main; args are passed to the program after --; project selects a project root in a multi-project workspace; env adds environment variables to the Elide process.

Two attach adapters are supported through elide.debug.adapter:

  • intellij (the default) uses the JVM debugger contributed by JetBrains.kotlin-server.
  • java uses Debugger for Java, which must be installed separately.

elide test accepts --debugger as well. A bare flag attaches JDWP to JVM tests on 127.0.0.1:5005, which these same adapters attach to, and --debugger=<port> moves that agent; a named guest mode (--debugger=dap) addresses guest JavaScript and TypeScript tests instead.

Settings

SettingDefaultDescription
elide.home""Distribution root containing bin/elide. Empty falls back to $ELIDE_HOME, the platform install locations, then elide on PATH.
elide.jdk.home""JDK for symbol resolution. Empty falls back to the manifest’s jvm.javaHome, then $JAVA_HOME, then installed JDKs matching jvm.target.
elide.sync.onStartuptrueSync when the workspace opens.
elide.sync.onManifestChange"prompt"always, prompt, or never when elide.pkl or the lockfile changes.
elide.kotlinLsp.writeWorkspaceJsontrueWrite <folder>/workspace.json.
elide.debug.adapter"intellij"intellij or java.