WynnLua — VS Code ExtensionA VS Code / VSCodium extension for developing Lua scripts against the WynnLua Fabric mod (Minecraft/Wynncraft client-side automation). What you get
Requirements
Install (developer mode)
Then open the Install (packaged
|
| Command | Default keybind | What it does |
|---|---|---|
WynnLua: Connect |
— | Manually connect to the WebSocket server |
WynnLua: Disconnect |
— | Stop the connection (disables auto-reconnect) |
WynnLua: Refresh Scripts |
— | Force the server to resend the script list |
WynnLua: New Script |
— | Prompt for a name, create an empty .lua, open it |
WynnLua: Run Active File |
Ctrl+F5 | Save current .lua and run it (or eval if outside scripts dir) |
WynnLua: Eval Selection |
Ctrl+Shift+E | Run highlighted code as one-shot REPL |
WynnLua: Open Terminal |
— | Show the colorized WynnLua terminal |
WynnLua: Show Output |
— | Show the LogOutputChannel for connection/debug logs |
WynnLua: Clear Output |
— | Wipe both the terminal and server-side console buffer |
WynnLua: Open API Reference |
— | Open API.md in markdown preview |
WynnLua: Sync Type Stubs |
— | Re-fetch globalTypes.d.lua from upstream and rewrite .luaurc |
Settings
| Setting | Default | Notes |
|---|---|---|
wynnlua.serverUrl |
ws://127.0.0.1:3004/ws |
WebSocket endpoint — matches /lua serve |
wynnlua.autoConnect |
true |
Connect automatically the first time the WynnLua view is opened in a session. Never fires in unrelated VS Code windows. |
wynnlua.autoReconnect |
true |
Reconnect after a live session drops (e.g., mod restart). Never retries a failed initial connect — one attempt, one error message, done. |
wynnlua.scriptsDir |
(auto-detect) | Path to config/wynnlua/scripts. Leave empty to auto-detect PrismLauncher default. Changing this at runtime rebuilds the file watcher automatically. |
wynnlua.typeStubsUrl |
upstream luau-lsp | Source URL for Roblox type stubs |
How type checking works
On first activation the extension:
- Detects your scripts dir (auto or from config)
- Copies our bundled
types/wynnlua.d.luauinto that dir - Fetches
globalTypes.d.luafrom luau-lsp upstream (cached in extension global storage, re-fetched weekly) - Copies it to the scripts dir alongside our stubs
- Writes
.luaurcand.vscode/settings.jsonsoluau-lsploads both files - Sets workspace-scoped
files.associationsto map*.lua→luaulanguage mode
luau-lsp then gives you:
- Full Roblox IntelliSense — every class, method, event, enum from the upstream API dump
- WynnLua-specific autocomplete —
LocalPlayer.WynnHp,wynn.char.hp(),World:GetMobs(30), etc. - Hover documentation — descriptions and parameter docs pulled from the type annotations
- Type checking — incorrect types, misspelled properties, missing arguments all flagged inline
Conflict handling
If you already have other Lua extensions (sumneko.lua, trixnz.vscode-lua, EmmyLua, etc.), the extension detects them on activation and shows a one-time info notification. The workspace-scoped files.associations override maps *.lua → luau inside the scripts dir only, so your other extensions stay active in other projects.
Troubleshooting
- Status bar shows
$(circle-slash) WynnLua: the extension can't connect. Make sure MC is running and/lua servehas been typed in chat. - Scripts tree is empty: connect first (
WynnLua: Connect), thenWynnLua: Refresh Scripts. - Autocomplete not working:
WynnLua: Sync Type Stubsto re-fetch. Check the Output panel (WynnLua) fortype sync failedmessages. - Script doesn't hot-reload on save: check the script is inside the
config/wynnlua/scripts/dir (not a different location). Configurewynnlua.scriptsDirif auto-detect picked the wrong path. - Conflicts with sumneko.lua: the extension detects this and shows a notification. The workspace-scoped mapping should prevent interference.
Architecture
┌──────────────────────┐
│ Minecraft + WynnLua │
│ Fabric mod │
│ (wynnlua-1.0.0.jar) │
└──────────┬───────────┘
│ /lua serve
▼
ws://127.0.0.1:3004/ws (Netty)
│
│ MessagePack-framed
│ JSON messages
▼
┌───────────────────────────────────────────────────┐
│ VS Code + wynnlua-ext │
│ ┌─────────────┐ ┌──────────────┐ ┌──────────┐ │
│ │ Scripts │ │ Pseudo- │ │ Output │ │
│ │ Tree │ │ Terminal │ │ Channel │ │
│ │ (sidebar) │ │ (ANSI color) │ │ (logs) │ │
│ └─────────────┘ └──────────────┘ └──────────┘ │
│ ┌───────────────────────────────────────────┐ │
│ │ Monaco Editor (your script .lua files) │ │
│ │ + luau-lsp for IntelliSense │ │
│ └───────────────────────────────────────────┘ │
└───────────────────────────────────────────────────┘
File layout
wynnlua-ext/
├── package.json extension manifest
├── extension.js main entry — activate, commands, watchers, handshake
├── client.js WebSocket + MessagePack client
├── scriptTree.js TreeDataProvider for the Scripts sidebar
├── types/
│ └── wynnlua.d.luau WynnLua-specific type stubs for luau-lsp
├── API.md flat API reference with status tiers
├── README.md this file
└── .vscodeignore files excluded from .vsix package
License
Same as the parent WynnLua project.