Unofficial Trailmakers modding API addon for LuaLS. Setups the LuaLS environment for development of Trailmakers mods
- Autocompletion, definitions and documentation of the modding API functions and types, as well as Moonsharp's additions that are enabled in game
- Sets the language server to the correct Lua version used in the game
- Removes definitions of functions and modules from the standard library that are disabled in game
- Install lua-language-server
- Clone this repository or download it as a
.zip
and unzip it. Place it inside a folder for LuaLS addons (e.g.~/documents/LuaAddons/
) - Add the file path of the addons folder to the
workspace.userThirdParty
LuaLS setting- VSCode
- Open command palette (
ctrl+shift+p
) from your mods folder - Select
Preferences: Open workspace Settings
- Search for
lua.workspace.userThirdParty
- Click "Add Item", enter the path of the addons folder, and click "Ok"
- Open command palette (
- Other editors: set the value of the LuaLS setting
Lua.workspace.userThirdParty
to an array with the path of the addons folder. You might want to set this only in the workspace settings of your mods folder
- VSCode
- After opening a lua file in the mods folder, you should be prompted to enable the addon. Select "Apply and modify settings". If you aren't prompted to enable the addon, verify that the LuaLS setting
workspace.checkThirdParty
is set totrue
- To remove duplicate documentation, remove the official documentation library file (
trailmakers_docs.lua
) from the mods folder
If you cloned the repository when downloading it, you can simply do a pull. If you downloaded it as a .zip
, you need to redownload it and replace your local copy with the new version