fivem
fivem copied to clipboard
SDK: LUA natives and runtime intellisense
Currently we lack builtin types information for lua-language-server.
This requires generating them in a format it likes (most likely like libs, see https://github.com/sumneko/lua-language-server/tree/master/3rd) and then force-feeding path to them to the extension like we do for tsserver
.
I'm gonna look into this. I'll update you with a prototype.
The output from codegen_out_lua.lua with USE_DOC_LUA = true
is compatible with sumneko annotations, though could maybe be adjusted in a few cases.
-
@comment
can just be@
- Hash would need to be a union type
string | number
(currently just number) - Some natives (i.e. GetGamePool) return type "object", which should be table (an array afaik)
- Need definitions for environment globals (like index.d.ts)
~~Publishing a vscode plugin (see: https://github.com/sumneko/lua-language-server/wiki/Libraries#bundling-in-a-plugin-extension) using codegen should work, similarly to the npm packages.~~ Not certain how you'd go about about differentiating client and server.
Lua addons can now be added as a submodule to https://github.com/LuaLS/LLS-Addons (see contributing) and loaded if fxmanifest.lua exists.