LumixEngine

Type Checking

Enabling Luau Type Checking in VS Code

  1. Install the Luau language server for VS Code.
  2. Open the data folder in VS Code.
  3. Create a VS Code workspace settings file at data/.vscode/settings.json.
  4. Add the following JSON configuration:
     {
         "luau-lsp.types.definitionFiles": ["scripts/lumix.d.lua"]
     }
    
  5. Create a .luaurc file in the data/scripts/ directory with the following content:
     {
         "languageMode": "nonstrict",
         "lint": { "*": true, "FunctionUnused": false },
         "lintErrors": true,
         "globals": ["expect"]
     }
    
  6. Type checking should now be enabled. You can test it with the following script:
     function onInputEvent(event : InputEvent)
         return event.some_prop
     end
    

Lumix Type Definitions

Lumix type definitions are available in the lumix.d.lua file. This file is generated by Meta tool.

Type checking inside Studio

To enable Luau type checking (including autocomplete and go-to-definition) in Studio, you must build Luau from source code as a static library. See the third-party page for instructions on compiling Luau from source.