fivem icon indicating copy to clipboard operation
fivem copied to clipboard

SDK: LUA natives and runtime intellisense

Open nihonium-cfx opened this issue 3 years ago • 2 comments

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.

nihonium-cfx avatar Feb 02 '22 10:02 nihonium-cfx

I'm gonna look into this. I'll update you with a prototype.

CollectivelyCode avatar Apr 28 '22 01:04 CollectivelyCode

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.

thelindat avatar Aug 30 '22 02:08 thelindat