# IntelliJ IDEA Plugin

> Import, run and debug Elide projects in IntelliJ IDEA.

## Requirements

- IntelliJ IDEA 2025.1 or newer.
- Elide installed ([Installation](https://elide.help/docs/installation)).
- A JDK registered in the IDE, for JVM projects.

## Install

In **Settings → Plugins → ⚙ → Manage Plugin Repositories**, add:

```text
https://plugins.elide.dev/intellij
```

Install **Elide** from the Marketplace tab and restart the IDE. Install **Pkl** from the same repository for
completion and inspections in `elide.pkl`.

## Import a project

Open a directory that contains `elide.pkl` ([Projects](https://elide.help/docs/projects)). The plugin links it and syncs in the background.

- Each source set becomes a module; dependencies become libraries with sources attached.
- The project SDK is the JDK for `jvm.target`, or the newest installed JDK.
- Editing `elide.pkl` or the lockfile prompts a reload.

The **Elide** tool window lists linked projects and has the reload actions.

## Run

Create an **Elide** run configuration. Its command line takes anything the CLI accepts, with completion:

```text
run
test -t 'MyTest'
serve --port 8080
run app.js -- --flag-for-the-program
```

Run and debug icons appear on `jvm.main`, `entrypoint` and `scripts` entries in `elide.pkl`, on `main` functions,
and on JUnit tests. **Run Anything** (double Ctrl) also accepts `elide …`.

## Debug

**Debug** on a `run` configuration adds `--debugger` and attaches the IDE's JVM debugger. To debug tests, run
`elide test --debugger` and attach a **Remote JVM Debug** configuration to `localhost:5005`. See
[Debugging](https://elide.help/docs/debugging).

## Choose an Elide install

**Settings → Build, Execution, Deployment → Build Tools → Elide** sets **Elide distribution** to *Auto-detect* or a
custom path. Auto-detect checks `$ELIDE_HOME`, then:

| Platform | Locations, in order |
| --- | --- |
| Unix | `$XDG_DATA_HOME/elide`, `~/.local/share/elide`, `/opt/elide/current`, `~/.elide` |
| Windows | `%LOCALAPPDATA%\elide`, `%ProgramFiles%\Elide`, `%USERPROFILE%\.local\share\elide`, `%USERPROFILE%\.elide` |
