MiliLua API Definitions is a VS Code extension that provides IntelliSense for the Miliastra Wonderland Lua API based on definitions and documentation from the miliastra-lua-api repo.
Get the extension from the Visual Studio Code Marketplace.
-
Open your project's
external_lua_filefolder in VS Code. -
Open a file with the
.luaextension. -
Select "Yes" when prompted whether to enable MiliLua for the current workspace.
See the IDE Setup section of haminpants' Lua Quickstart Guide for more info.
- Complete definitions for all types, fields, functions, globals, and enums.
- Additional aliases and classes to provide additional typing and IntelliSense:
TweenTarget, containing all tweenable Client Control fields.Vector3, to represent the 3D Vector data type.ApiType, containing all known return values from thetypeoffunction.
- Extended documentation verified through testing.
- Snippets for commonly used blocks of code.
| Setting | Type | Description |
|---|---|---|
mililua.enableDefinitions |
boolean |
(Workspace only) Whether to enable Miliastra Wonderland Lua API definitions for the current workspace. |
| Prefix | Description |
|---|---|
mili-lifecycle |
Generates all lifecycle functions. |
function OnInit()OnInit |
Generates the OnInit lifecycle function. |
function OnEnable()OnEnable |
Generates the OnEnable lifecycle function. |
function OnStart()OnStart |
Generates the OnStart lifecycle function. |
function OnUpdate()OnUpdate |
Generates the OnUpdate lifecycle function. |
function OnLevelUpdate()OnLevelUpdate |
Generates the OnLevelUpdate lifecycle function. |
function OnDisable()OnDisable |
Generates the OnDisable lifecycle function. |
function OnDestroy()OnDestroy |
Generates the OnDestroy lifecycle function. |
mili-tweengame.Tween |
Generates Tween starter code. |
mili-tween-one-shot |
Generates a Tween that calls Kill when completed. |
mili-tween-sequence-one-shot |
Generates a Tween Sequence that calls Kill when completed. |
- Functions that return
ClientUIBaseControldo return the exact runtime type; however, LuaLS cannot infer the correct type, so an alias containing all Client Control types is returned instead. - Functions that return data from the server, such as from signals or
game.GetGlobalCustomVariableValue, will always return a type from theServerDataTypealias ornil; however, LuaLS cannot infer the correct type, soanyis returned instead. TweenTargetexposes all tweenable fields from all Client Control types; however, attempting to tween fields for the wrong type may cause errors at runtime.

