pub struct LuaDebugAdapter;Expand description
Factorio provides a Debug Adapter for compatible tools in single-session mode on stdin/stdout when launched with the --dap command line argument.
The Debug Adapter supports a Launch request with the following arguments:
-
factorioArgs:: array[string]? : Command line arguments for the debug session -
followSymlinks:: boolean? : Follow symlinks when emitting locations (stack traces, etc) (default: true) -
trace:: boolean? : Trace DAP messages to adap-trace.log(default: false)
Metatable methods may be used to customize debug views:
-
__tostring(self) -> string : Called when the object appears as a value. -
__debugcounts(self) ->indexedVariables:: int32 ,namedVariables:: int32 : Called when the object appears in a parent object’s listing, to estimate the size of this object’s listing, and enabled paged listing for large indexed objects. -
__debugchildren(self,filters:: DebugVariablesFilter) -> array(DebugVariable) : Called when the object itself is opened for a debug listing. If__debugcountswas implemented, the client may choose to fetch Indexed and Named children separately, and Indexed children in pages as-needed for display. See also describe_field.
This class also provides debug session APIs, as the global object debugadapter in all stages.
Implementations§
Source§impl LuaDebugAdapter
impl LuaDebugAdapter
Sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
The value from the tags property of the current session’s launch request
Sourcepub fn valid(&self) -> bool
pub fn valid(&self) -> bool
Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
Sourcepub fn describe_field(&self, name: &str, value: LuaAny) -> DebugVariable
pub fn describe_field(&self, name: &str, value: LuaAny) -> DebugVariable
Prepare a default debug view entry for a field, to assist in preparing custom listings.
Sourcepub fn start_profile(&self, params: LuaDebugAdapterStartProfileParams)
pub fn start_profile(&self, params: LuaDebugAdapterStartProfileParams)
Start recording profiler timings. If there is a previous recording session running, it will be stopped first.
Sourcepub fn stop_profile(&self)
pub fn stop_profile(&self)
Stop recording profiler timings and save to script_output.
Trait Implementations§
Source§impl Clone for LuaDebugAdapter
impl Clone for LuaDebugAdapter
Source§fn clone(&self) -> LuaDebugAdapter
fn clone(&self) -> LuaDebugAdapter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more