This repo contains Lua stubs which can be used by sumneko's Lua language server for VSCode.
When updating the stubs, make sure you're using Python 3 and have requests
installed.
Download the latest release from GitHub releases
These docs are only for Visual Studio Code and sumneko's Lua language server, for other editors/servers your mileage may vary.
- Open Visual Studio Code
- Click View -> Extensions or (Ctrl + Shift + X)
- Lua -> Cogwheel (Bottom Right) -> Extension Settings
- Scroll down until you see "Lua › Workspace: Library"
- Click
Edit in settings.json
- Add the following within the braces:
"Lua.workspace.library": {
"C:/fivemstubs": true,
},
Where C:/fivemstubs
is the path to the stubs on your disk.
- Open the workspace for your project you want to add the stubs too
- Press Ctrl + Shift + P
- Type in
open worksp
and press enter on theOpen Workspace Setting (JSON)
- Add the following within the braces:
"Lua.workspace.library": {
"C:/fivemstubs": true,
},
If you're using FiveM's FXServer you should add the following path to the libraries list: C:/server/citizen/scripting/lua
where server
is the folder which contains FXServer.exe
Support will be given for the stub generator, missing or unexpected behaviour from the stubs but not for anything else.