Skip to content

Language servers & editor intelligence ​

How Stationeers-specific help and general Lua (lua-language-server) combine in different places.

In-game IC10Editor ​

SourceWhat it does
LuaLanguageServiceIn-process Stationeers LSP used by the default LuaFormatter when ExternalLuaLanguageServerPath is empty (completions, hover, diagnostics, format).
Optional lua-language-server (stdio)When ExternalLuaLanguageServerPath is set, the mod registers LuaFormatterExternalLsp (IC10Editor LSPFormatter) with a shared LspClientStdio. The vanilla formatter integration drives document sync, diagnostics, completion, etc.; debounced textDocument/hover is merged into tooltips. LuaLanguageService is not the active formatter in that mode, but the TCP LSP for VS Code is unchanged.

Configure external Lua LS for the in-game editor ​

All keys are in [MCP Server] (same BepInEx section as the HTTP bridge / TCP LSP toggles):

  1. Download a lua-language-server build for your OS from LuaLS releases (extract the archive).
  2. Set ExternalLuaLanguageServerPath to the full path of the executable, for example:
    • Windows: C:\Tools\lua-language-server\bin\lua-language-server.exe
    • Linux: /home/you/.local/bin/lua-language-server
  3. Leave ExternalLuaLanguageServerArguments empty unless your build needs extra flags (default stdio mode).
  4. Restart the game (or reload the mod) so the process can start the first time you open autocomplete in a Lua chip.

When ExternalLuaLanguageServerWorkingDirectory is empty, the mod starts lua-language-server with working directory StationeersLua/Assets/LuaLibrary next to the deployed DLL, which ships a .luarc.json plus the same LuaCATS *.lua stubs as the VS Code extension (copied at build time). That sets Lua.runtime.version to Lua 5.2 and disables builtins that the chip VM does not expose (io, package, debug, stock os, etc.), with a narrow stationeers-os.lua stub for the allowed os subset.

The in-game document URI is a virtual buffer (memory:///…); Lua LS still reads workspace settings from the Assets/LuaLibrary folder above.

If you override ExternalLuaLanguageServerWorkingDirectory, place your own .luarc.json there and keep Lua.runtime.version": "Lua 5.2" so analysis matches LuaCSharp (Lua 5.2).

Notes ​

  • First autocomplete after a change can take a moment while the subprocess initializes and syncs the buffer.
  • Dedicated / batch servers do not start the external LS.
  • Player-facing setup assumes IC10Editor is installed. The no-editor fallback mainly matters for dedicated or stripped-down technical installs.
  • If the path is wrong, the mod logs a warning once and skips the external client.
  • Squiggles only apply while your buffer matches the last text synced to Lua LS; typing clears external errors until the next sync/diagnostic round.

TCP: game as server (Stationeers LSP for VS Code, etc.) ​

[MCP Server] EnableLspServer / LspPort start a TCP listener inside the game. External programs connect in to the mod’s Stationeers LSP server - not the same thing as ExternalLuaLanguageServerPath (which runs out-of-process general Lua LS for the in-game editor).

  1. EnableLspServer = true, LspPort (e.g. 3031, not the HTTP 3030 port).
  2. VS Code: stationeers-lua.lspPort matches LspPort, extension connected to the game.

The Stationeers TCP LSP provides completions, hover, signature help, diagnostics, require() network completions, document symbols (Outline panel), and go-to-definition in VS Code.

Details: VS Code Extension → IntelliSense & Language Server.


“Stacked” in VS Code (Sumneko + Stationeers TCP) ​

LayerRole
Sumneko LuaRuns lua-language-server for normal Lua in the editor.
Stationeers LSPTCP client to the game when EnableLspServer is on.

That stack is desktop-only. The in-game path uses The internal mod language server + optional ExternalLuaLanguageServerPath instead of Sumneko.


Other desktop editors ​

Run lua-language-server from upstream and point your editor at it. Add Stationeers API stubs with workspace.library pointing at the library/ folder shipped inside the Stationeers Lua VS Code extension install (VS Code Marketplace · Open VSX) (on disk, under your editor’s extensions directory, for example %USERPROFILE%\.vscode\extensions\orbitalfoundrymoddingcrew.stationeers-lua-*\library\ on Windows, or the same path under .cursor\extensions\ if you use Cursor). Attaching also to the game’s Stationeers TCP LSP depends on your editor supporting two Lua LSP clients.


Mod config reference ​

SettingSectionPurpose
EnableLspServer[MCP Server]TCP listener for external Stationeers LSP clients (VS Code).
LspPort[MCP Server]TCP port (default 3031).
ExternalLuaLanguageServerPath[MCP Server]Full path to lua-language-server for in-game merged completions, signature help, hover fallback, diagnostics, semantic tokens; empty = off.
ExternalLuaLanguageServerArguments[MCP Server]Optional extra CLI args for that executable.

See MCP Server & Reference Panel for HTTP/MCP and the reference panel.

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