Tracker: LuaLS annotations for LuaRT modules
I'm planning on adding LuaLS integration to LuaRT. This issue is a progress tracker for it.
Progress
- [ ] sys
- [ ] net
- [ ] compression
- [ ] ui
- [ ] canvas
- [ ] string
- [ ] sqlite
- [ ] console
- [ ] json
- [ ] crypto
- [ ] webview
- [ ] base
- [ ] audio
Further ideas:
- first class lite-xl support?
- bundle LuaLS?
Lua Language Server support for LuaRT will be a great move. If you have questions or need help just ask 😉
@samyeyo Would it be okay if I put the type annotations to types/ or lib/types?
Yes lib/types should be more appropriated
Hi @samyeyo, do you have time to assistance on the lrtobjects? I'm a bit confused about the API design
Yes, sure, how can I help you ?
If I understood that correctly, it could be a userdata type abstracted as a @class, but I'm not sure how can I define the getter & setter functions, instancing and inheritance
https://github.com/LuaLS/lua-language-server/wiki/Annotations
as it's the base of many other interfaces, this need to be completely typed in the annotations
if there are any features missing in the language server, leave a feedback here and I will open an issue upstream.
In fact there are two types of objects :
- C objects defined in C, linked to a
userdata - Lua objects, defined in a Lua script, not linked to a
userdata
A Lua defined object can single inherit both kind of objects A C defined object don't have inheritance (it can be simulated as for ui Widgets)
A getter function starts with get_ and setters with set_
An instance has a table named __type in it's metatable, that contains a field __name set to a string, the name of the object/class