This release gives you access to snippets and completions for several editors including Sublime Text, Visual Studio Code, Atom, and Notepad++. It supports both GTA’s native methods and the ones FiveM adds. Functions found in scheduler.lua, natives_server.lua, and natives_universal.lua are all included.
I’m open to suggestions on any other editors to implement autocompletions for. Furthermore, if there are any problems with the files provided here, feel free to let me know.
Downloads
Removed due to dead links
Preview
Installation
Sublime Text: drop the fivem.sublime-completions into %AppData%/Sublime Text 3/Packages
Visual Studio Code: drop the lua.json into %AppData%/Code/User/snippets
Atom: drop the snippets.cson into %UserProfile%/.atom/Packages
Notepad++: drop the lua.xml into %ProgramFiles%/Notepad++\plugins\APIs (dependent on install location)
Readme files are provided which go into more detail if required.
Source Code
The script that generates these snippets is available for viewing at the following repository:
I am aware of the existing Sublime Text and VS Code snippets (not any for Atom). However, they are outdated by several months at this point and they only include the natives from native db - not the CitizenFX ones.
I’ve created a script that parses the functions from a Lua script file and automatically generates these snippets, so I plan to keep these up to date. I’ll be throwing the script up on GitHub later on so others can extend it if they so choose.
In addition, I’m going to continue creating snippets for other editors as requested.
This is awesome!
PS: If anyone uses LuaExtended on Sublime Text 3 (like I do), just change source.lua to source.luae in the fivem.sublime-completions file.