Tencent / UnLua

A feature-rich, easy-learning and highly optimized Lua scripting plugin for UE.
Other
2.24k stars 614 forks source link

Intellisense not generated for statically exported functions using ADD_LIB #702

Open op1337 opened 5 months ago

op1337 commented 5 months ago

IntelliSense data is not generated for statically exported functions using ADD_LIB. For example, LuaLib_Object.cpp has its functions exported in the following way:

/**
 * Glue functions for UObject
 */
static const luaL_Reg UObjectLib[] =
{
    {"Load", UObject_Load},
    {"IsValid", UObject_IsValid},
    {"GetName", UObject_GetName},
    {"GetOuter", UObject_GetOuter},
    {"GetClass", UObject_GetClass},
    {"GetWorld", UObject_GetWorld},
    {"IsA", UObject_IsA},
    {"Release", UObject_Release},
    {"Destroy", UObject_Release},
    {"__eq", UObject_Identical},
    {"__gc", UObject_Delete},
    {nullptr, nullptr}
};

/**
 * Export UObject
 */
BEGIN_EXPORT_REFLECTED_CLASS(UObject)
    ADD_LIB(UObjectLib)
END_EXPORT_CLASS()

IMPLEMENT_EXPORTED_CLASS(UObject)

However, the generated IntelliSense file in IntelliSense/StaticallyExports/UObject.lua is as shown:

---@type UObject
local M = {}

return M

None of the functions are added to the IntelliSense file. This behavior is seen with all functions exported using ADD_LIB.