This repository contains EmmyLua annotations for ScheduleLua modding, providing intellisense, autocomplete, and type checking for the ScheduleLua API when developing mods.
- Visual Studio Code
- Lua Language Server extension by sumneko
-
Install the Lua Language Server extension:
- Open VSCode
- Go to Extensions (Ctrl+Shift+X)
- Search for "Lua" by sumneko
- Click Install
-
Setup the provided annotations:
- Clone or download this repository to your local machine
- Copy the
libs
folder to your mod project directory - Add the provided
.luarc.json
file to your mod project root directory
-
Install the ScheduleLua Extension:
- Download the provided
.vsix
file - Open VSCode
- Go to Extensions (Ctrl+Shift+X)
- Click the "..." menu in the top-right of the Extensions panel
- Select "Install from VSIX..."
- Choose the downloaded
.vsix
file
- Download the provided
-
Using the Extension Commands: The extension provides three convenient VSCode commands:
ScheduleLua: Setup Workspace for Mod Development
- Automatically configures your workspace with ScheduleLua annotationsScheduleLua: Create New Mod Template
- Creates a new mod project with the basic structureScheduleLua: Show API Documentation
- Opens the ScheduleLua API documentation website
- Setup your workspace for ScheduleLua mod development
- You should now have full syntax support for ScheduleLua
When deploying your mod for others to use:
- Do not include the
libs
or.vscode
folders, and.luarc.json
file in your final mod distribution - These files are development tools only and not required for your mod to function
- Only include your actual mod files (scripts, assets, etc.) in the distribution
When using the VSCode annotations, follow this guide for the best/easiest route:
- Install the
.vsix
extension from releases - Create a development folder somewhere (e.g. Desktop) and name it something like
Lua Mods
- Open the newly created folder in VSCode
- Run the
ScheduleLua: Setup Workspace for Mod Development
command to setup your new folder for ScheduleLua development. - Now whenever you want to make a mod, run the
ScheduleLua: Create New Mod Template
command in your newly setup workspace/folder.
If intellisense is not working:
- Make sure the
.luarc.json
file is in your project root - Verify the path in
.luarc.json
correctly points to the libs folder - Restart VSCode
- Check VSCode's output panel for any Lua Language Server errors
If you find any issues with the annotations or want to improve them, feel free to submit a pull request.