debug. setinfo Synchronous
setinfo
Update the supported debug metadata of a Luau function or frame. It is useful for giving a generated function a clearer name or source label in later diagnostics.
Luau
debug.setinfo(target: DebugTarget, info: DebugInfoUpdate) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
target | DebugTarget | A Luau function, visible stack level, or ProtoProxy. Indexes in these APIs start at 1. |
info | DebugInfoUpdate | Table containing supported source, short_src, name, or currentline fields. |
Argument fields
Luau
DebugTarget = Function | number | ProtoProxyLuau
DebugInfoUpdate = {source: string?, short_src: string?, name: string?, currentline: number?}Returns
()No value.
Usage notes
Only supported metadata fields are applied; this does not rewrite executable code.
Example
Luau
local function generated() end
debug.setinfo(generated, { name = "generated handler" })
print(debug.getinfo(generated).name)