samyeyo / LuaRT

Open source Windows programming framework for Lua
https://www.luart.org
Other
287 stars 20 forks source link

Tracker: LuaLS annotations for LuaRT modules #92

Open mochaaP opened 1 year ago

mochaaP commented 1 year ago

I'm planning on adding LuaLS integration to LuaRT. This issue is a progress tracker for it.

Progress


Further ideas:

samyeyo commented 1 year ago

Lua Language Server support for LuaRT will be a great move. If you have questions or need help just ask 😉

mochaaP commented 1 year ago

@samyeyo Would it be okay if I put the type annotations to types/ or lib/types?

samyeyo commented 1 year ago

Yes lib/types should be more appropriated

mochaaP commented 1 year ago

Hi @samyeyo, do you have time to assistance on the lrtobjects? I'm a bit confused about the API design

samyeyo commented 1 year ago

Yes, sure, how can I help you ?

mochaaP commented 1 year ago

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

mochaaP commented 1 year ago

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.

samyeyo commented 1 year ago

In fact there are two types of objects :

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)

samyeyo commented 1 year ago

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