Skip to content

VS Code Extension ​

The StationeersLua VS Code extension connects VS Code to the running game, giving you a full external editing and debugging workflow for Lua (and IC10) chips.

Install from VS Code Marketplace → · Open VSX (VSCodium / VS Code OSS) →

Installation ​

Install the extension from the VS Code Marketplace or from Open VSX if you use VSCodium or another editor that uses the Open VSX registry.

The extension depends on the Lua Language Server (sumneko.lua) for IntelliSense and will prompt you to install it if missing.

Setup ​

  1. Make sure the StationeersLua mod is installed and EnableExtensionApi is true in the mod config
  2. Launch Stationeers and load a world
  3. Open your Lua workspace in VS Code
  4. Run StationeersLua: Connect to Game Server from the command palette
  5. Ensure the game exposes chips to the bridge:
    • Wired: open the in-game IC editor on a computer and select a chip, or
    • Wireless: equip a suit with the Wireless Development Board connected to a network, with AllowNetworkChipAccess enabled (see Wireless Development Board), or
    • PAN: wear a Suit Networking Module or dev board with AllowPersonalAreaNetworkChipAccess enabled (see Suit Networking Module)
  6. Use the Chips sidebar to browse and open chips

You do not need the IC editor open when wireless or PAN remote access alone is enough — the explorer lists every chip the game reports as accessible for your player.

For the full HTTP route reference (OpenAPI / Swagger), see Extension REST API (Swagger).

Chip Explorer ​

The extension adds a StationeersLua panel to the VS Code activity bar with a Chips tree view.

The explorer shows:

  • All accessible Lua and IC10 chips, grouped by data cable network
  • Library modules as children of their parent chips
  • Cross-references for loaded library dependencies
  • Inline actions for Pull, Export, and Debug on each chip row

The explorer auto-refreshes metadata in the background (configurable interval). Code is never pulled without an explicit action.

Editing Workflow ​

Opening a Chip ​

Click a chip in the sidebar to pull its current source into a temporary .lua file in VS Code.

Sync on Save (Draft Mode) ​

When syncOnSave is enabled (default), saving the file updates the in-game IC editor draft for the selected chip. This lets you see your changes in the editor without compiling.

Saving does not export to the chip.

Exporting ​

To compile code onto the chip, use one of:

  • The Export icon on the chip row in the sidebar
  • StationeersLua: Export Chip to Game from the command palette

This separation keeps draft editing distinct from chip compilation.

Pulling ​

Use the Pull icon or StationeersLua: Pull Code from Chip to refresh the local file from the chip's current compiled source.

Conflict Detection ​

The extension tracks a source_version for each chip. When external changes are detected (from the in-game editor, AI editors, or other players):

  • If you have no local modifications, the remote change is auto-synced silently
  • If you have unsaved local changes, you're prompted to accept the remote update or keep your local version

Debugger Experimental ​

The VS Code debugger requires EnableExperimentalDebugger = true in the [MCP Server] config section. When disabled (the default), the Debug button is hidden in the Chip Explorer and all debug endpoints return an error.

Experimental Feature

The VS Code debugger is experimental and may have bugs. If you encounter issues, please report them on the Discord server.

The extension includes a full Debug Adapter Protocol implementation for Lua chips.

Capabilities ​

  • Attach to running Lua chip runtimes
  • Breakpoints — line, conditional, hit count, and logpoints
  • Pause / Continue / Step — step over, step in, step out
  • Stack frames, scopes, and variables inspection
  • Set variable values during a paused session
  • Exception handling — break on all exceptions filter
  • Debug Console — runtime errors and Lua tracebacks surface inline

Starting a Debug Session ​

Use the Debug icon on a Lua chip in the Chip Explorer, or create an attach launch configuration:

json
{
  "type": "stationeers-lua",
  "request": "attach",
  "name": "Attach to Lua Chip",
  "chipRefId": 12345,
  "stopOnEntry": false
}

TIP

Debugging is Lua chips only — IC10 chips can be opened and exported but not debugged through VS Code.

Multiplayer ​

Your extension always connects to the local HTTP listener in your game client (EnableExtensionApi on that machine). On a dedicated server or when you are a pure client, chip list, code export, and editor state are executed on the server via the mod proxy; the server applies the same access rules as single-player (editor, wireless board, PAN module, config toggles).

Debugging requires AllowMultiplayerDebugProxy on the server. VS Code still attaches through your local client; debug commands are proxied to the server and attributed to your player connection.

IntelliSense & Language Server ​

For a full map of where intelligence runs (in-game vs VS Code vs optional lua-language-server), see Language servers.

The extension provides two layers of code intelligence that work together:

Sumneko Lua (General Lua) ​

When connected to the game, the extension automatically adds its bundled Lua type stub files to the Sumneko Lua workspace library. This gives you general-purpose Lua autocomplete, hover docs, type checking, go-to-definition, and refactoring for:

Stub fileCoverage
stationeers-ic.luaCore ic.* API — device I/O, batch, slots, memory, stack
stationeers-globals.luaGlobal functions — sleep, yield, print, device_id, etc.
stationeers-util.luaUtility API — util.* functions
stationeers-ss.luaScriptedScreens API (when ScriptedScreens is installed)

Stationeers LSP (Game-Specific Intelligence) ​

When EnableLspServer is enabled in the mod config, the extension also connects to a Stationeers-specific LSP server running inside the game. This provides live, context-aware intelligence that static stubs cannot:

FeatureDescription
DiagnosticsReal-time Lua parse and compile error highlighting
Enum completionsic.enums.LogicType. and other ic.enums.* tables (including SorterInstruction, ConditionOperation) trigger member completions with numeric values
Constant completionsic.const. triggers all game constants
Parameter-aware completionsSecond arg of ic.read() suggests LogicType members; third arg of ic.read_slot() suggests LogicSlotType members
require() completionsInside require("..."), module names from library chips on the chip's data network are suggested
HoverEnum member and constant values, API signatures and descriptions
Signature helpFunction parameter highlighting with documentation

Completions are scoped to the data network of the chip being edited — require() suggestions only show modules reachable from that chip's network. This works correctly with wired editors, wireless development boards, and combined access.

TIP

The two language servers complement each other: Sumneko handles general Lua analysis (types, refactoring, unused variables), while the Stationeers LSP provides live game data (actual enum values, available library modules, parse diagnostics from the game's Lua compiler).

Snippets ​

The extension ships 23 code snippets for common patterns:

PrefixDescription
tickTick function skeleton
read / writeDevice read/write by pin
readid / writeidDevice read/write by reference ID
batchreadBatch read pattern
devlistDevice list iteration
sleepSleep call
requireRequire a library module
moduleModule annotation for library chips
lt / lst / bmLogicType / LogicSlotType / BatchMethod shorthand
httpgetHTTP GET request
subscribe / broadcastNetwork pub/sub
surfaceScriptedScreens surface setup
sslabel / ssbutton / sscanvas / sslayoutScriptedScreens UI elements
sstargetScriptedScreens tablet target
sstemplateFull ScriptedScreens template

AI Editor MCP Configuration ​

The StationeersLua: Configure AI Editor (MCP) command generates MCP config files so AI editors can connect to the in-game MCP server. Supported editors:

  • Cursor — writes .cursor/mcp.json
  • Windsurf — writes ~/.codeium/mcp_config.json
  • Claude Code — writes .mcp.json
  • VS Code Copilot — writes .vscode/mcp.json

Commands ​

CommandDescription
Connect to Game ServerEstablish connection to the StationeersLua HTTP server
Disconnect from Game ServerDrop the active connection
Refresh Chip ExplorerForce-refresh the chip tree
Open ChipPull a chip's source into a local temp file
Export Chip to GameCompile and export local source to the chip
Pull Code from ChipRefresh local file from the chip's compiled source
Debug ChipAttach the VS Code debugger to a Lua chip
Configure AI Editor (MCP)Generate MCP config for supported AI editors

Settings ​

SettingTypeDefaultDescription
stationeers-lua.gameServerUrlstringhttp://127.0.0.1:3030Base URL for the in-game HTTP server
stationeers-lua.syncOnSavebooleantrueSync the in-game editor draft on save
stationeers-lua.autoRefreshChipExplorerbooleantrueAuto-poll chip explorer metadata
stationeers-lua.chipExplorerRefreshIntervalMsnumber5000Poll interval in ms (1000–60000)
stationeers-lua.lspPortnumber3031TCP port for the Stationeers LSP server (must match LspPort in mod config)

Status Bar ​

The extension adds a status bar item showing the current connection state. Click it to connect or reconnect.

When connected:

  • IC editor open with a selected chip — shows the holder label from the game (what you see in the in-game dropdown) and a tooltip that includes the chip ref when the game provides one.
  • Wireless-only remote access (wireless_remote_access_only from the game) — shows Wireless link; the tooltip names the remote data network and explains that there is no IC editor selection — pick chips from the explorer.
  • IC editor open but no holder label — Editor Open.
  • Otherwise — No Editor (no bridge context yet).

The tooltip does not show a bogus ref null line when no chip ref is available.

⚠️ This documentation was AI-generated and may contain inaccuracies. Please submit pull requests with corrections as needed.