Skip to content

vscode-extension: LuaMap Tools for VS Code over LuaBridge - #13

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789751435-vscode-ext
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789751435-vscode-ext

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Adds vscode-extension/, a TypeScript VS Code extension that speaks the existing LuaBridge loopback NDJSON protocol (v1) — the new supported IDE path. The IntelliJ plugin (ide-plugin/) is marked deprecated but retained: Gradle composite build, launcher fatJar bundling, and --setup-ide/--ide are untouched, so nothing regresses.

Extension contents:

  • src/luabridge.ts — vscode-free protocol layer: encodeRequest/LineFramer (incremental NDJSON decode) and BridgeClient (net.Socket, pipelined requests matched by id, state machine disconnected→connecting→connected|error, close/drop callbacks). All I/O is event-driven — nothing blocks the extension host UI.
  • src/session.tsLuaBridgeSession controller: connect/disconnect/reconnect, ~1.5 s auto-reconnect, periodic poll (status + an eval of an npc.list() CSV snippet — no mod/protocol change needed), plus parseStatus/parseNpcs/replyText shared helpers.
  • src/sidebar.ts — activity-bar container with three tree views: Session (state + Connect/Disconnect/Reconnect/Run/Evaluate/Query actions), NPCs (live inspector: name + x/y/z, refreshes each poll), Scripts (list results, click to run).
  • src/completion.ts — Lua completion + snippets for world.*, npc.*, player.*, chat, log, print.
  • src/extension.ts — commands LuaMap: Connect/Disconnect/Reconnect/Run Script/Evaluate Lua/Query Block/Refresh NPCs, status-bar badge, LuaMap output channel as the eval/console log, settings luamap.bridge.host/port (defaults 127.0.0.1:25575), luamap.autoReconnect, luamap.pollIntervalSeconds. Disposal kills sockets + timers.

Tests: 14 node:test cases over a mock loopback NDJSON server — framing (partial/coalesced/blank/malformed lines), v1 wire format, id-matched pipelining, connect/drop/reconnect + session polling, status/NPC/block/error reply parsing. npm test = tsc + node --test, no VS Code instance needed.

Verification

Limitations

  • Extension UI not exercised inside a live VS Code on this headless VM — correctness is covered at the protocol/session layer only.
  • NPC inspector state = name + position only (the mod exposes no richer live state).
  • No breakpoint debugging — protocol has no frame/step ops (documented roadmap).
  • --setup-ide/--ide still provision IntelliJ + the deprecated plugin; a follow-up could swap that to code --install-extension once this path has soaked.

Link to Devin session: https://app.devin.ai/sessions/f2c11399d60948a394f9836472375e2f
Open in Devin Desktop: https://app.devin.ai/desktop/session/f2c11399d60948a394f9836472375e2f?variant=devin
Requested by: @CommunityPoke

TypeScript extension: net.Socket NDJSON client (protocol v1), status-bar
badge, activity-bar sidebar (session actions, live NPC inspector, script
runner), eval console, world.getblock query, Lua autocomplete+snippets,
LuaMap: Connect/Disconnect/Reconnect/Run Script/Evaluate Lua/Query Block
commands. 14 node:test unit tests over a mock loopback NDJSON server.
ide-plugin marked deprecated (retained; Gradle/launcher wiring unchanged).

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant