Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ luamap-run/
ide-plugin/.intellijPlatform/
# managed IDE runtime artifacts
.luamap/

# JVM crash logs
hs_err_pid*.log
23 changes: 18 additions & 5 deletions ide-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ the protocol documented in `../docs/luabridge.md`.
- "LuaMap Script" run configuration (host/port/script) that sends the script
to LuaBridge (`run` op) and prints script output in the Run console.
- Gutter run marker on `.luamap` files (wires into the run configuration).
- "LuaMap" tool window stub for the block-preview panel (to be driven by
`world.getblock`/`world.fill` queries over LuaBridge).
- `LuaBridgeClient` — synchronous newline-delimited-JSON socket client for the
bridge protocol.
- Live "LuaMap" tool window: host/port connect controls, connection badge
(Connected/Connecting/Error/Disconnected), auto-reconnect, periodic
status polling and NPC inspector (`npc.list()` via `eval`), block query
(`world.getblock`), script list + run/reload, and an eval console — all
socket I/O off the EDT via `LuaBridgeSession`'s background executor.
- `LuaBridgeClient`/`LuaBridgeSession` — synchronous NDJSON socket client
plus a lifecycle/polling controller for the bridge protocol.

## Build

Expand Down Expand Up @@ -56,5 +59,15 @@ use the gutter/run button or a "LuaMap Script" run config pointed at

- True debugger UI (breakpoints/step-through) — protocol has the `eval`/`run`
shape to hang a debug session on, but no frame model exists in the mod.
- Block preview rendering (tool window is a placeholder panel).
- Block preview *rendering* (the tool window queries blocks via
`world.getblock` but doesn't draw a region map).
- Error squiggles mapping LuaError line numbers back into the editor.

## Tests

`./gradlew :ide-plugin:unitTest` — loopback integration tests: a mock NDJSON
bridge server exercises connect/disconnect/reconnect, status transitions,
auto-reconnect, NPC + block responses, and protocol framing. The platform
`test` task is disabled (its IDE runtime harness doesn't work on the unified
2025.3 distribution); `unitTest` runs on a plain JVM and is wired into
`check`.
27 changes: 27 additions & 0 deletions ide-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,33 @@ dependencies {
instrumentationTools()
pluginVerifier()
}

// Gson ships on the IDE classpath at runtime; declare it for tests.
testImplementation 'com.google.code.gson:gson:2.11.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

// The platform's `test` task runs inside the IDE runtime (PathClassLoader,
// coroutines javaagent) — broken on the unified 2025.3 distro and unneeded
// for our pure-JVM bridge/session unit tests. Disable it and run them on a
// plain JVM via `unitTest` instead (wired into `check`).
test {
enabled = false
}

tasks.register('unitTest', Test) {
useJUnitPlatform()
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
javaLauncher = javaToolchains.launcherFor(java.toolchain)
testLogging {
events 'passed', 'failed', 'skipped'
}
}

check {
dependsOn tasks.named('unitTest')
}

// Boots the IDE headless to index settings UI — the plugin has no settings
Expand Down
Loading