breakpoints
Path: examples/breakpoints.
A tiny control mod for exercising Rust-line breakpoints through
factorio-rs dap. Comments in src/lib.rs mark the best
gutter lines to stop on.
Try it
Section titled “Try it”Prerequisites: Factorio 2.1+, FACTORIO_PATH, and the
factorio-rs DAP editor contribution.
cd examples/breakpointsfactorio-rs build --profile debug # writes dist/lua/*.lua.map.jsonIn VS Code / Zed:
- Open
examples/breakpointsas the folder or focussrc/lib.rsunder the monorepo - Set a gutter breakpoint on a line
- Start factorio-rs DAP - VS Code uses
.vscode/launch.json; Zed uses.zed/debug.json(installeditors/zed-factorio-rs-dapas a dev extension first) - Close any other Factorio window, then load/create a game so
controlruns
| Handler | Best stop | When it runs |
|---|---|---|
on_singleplayer_init |
debugger_breakpoint!(...) line |
New singleplayer game |
on_tick |
if game.tick() % 60 == 0 |
Once per second while playing |
on_player_created |
if let Some(player) = ... |
Player entity created |
debugger_breakpoint! only pauses with FMTK’s legacy __DebugAdapter global.
Under native Factorio 2.1 DAP, set a gutter breakpoint on a STOP line.