How it works
LuaDebug parses Lua itself, then loads framework API description files (plain Lua plus comment tags) according to luadebug.apiType, so engine methods show up in completion.
--[[
@SuperType [SomeFile#CCNode]
]]
CCPhysicsWorld = {}
--[[
@return [SomeFile#CCPhysicsWorld]
]]
function CCPhysicsWorld:create(gx, gy) end
The example defines a module and a method; tags drive type inference. The style matches game Lua, plus tags.
Set apiType
- Open Settings and search
luadebug.apiType. - Pick per project:
none/cocos2dx2/cocos2dx3/cocos2dx4/ulua/slua/xlua. - For multiple projects, set this in workspace settings. Reload the window after changing it.
Built-in & custom API files
The extension api/ folder already ships common framework APIs. To override or extend:
- Create a folder under the script root and put your own API Lua there.
- Make sure it is indexed (inside scriptRoots and not ignored).
- Describe types with tags; see Tags.
Generating API from bindings (outline)
You can scan engine bindings or C# exports and generate tagged Lua API files. For this product:
- Prefer the built-in
apiTypepacks; - fill gaps with handwritten API files plus tags;
- drop generated files into the project and keep them indexed.
If API hints look wrong, first check apiType and that the workspace is the current project.