mirror of
https://github.com/actions/runner.git
synced 2026-07-03 11:06:08 +08:00
The DAP debugger needs to map a runtime IStep back to a source line
when answering `stackTrace` requests. The renderer (#PR1b) produces
the YAML and per-entry start lines from an immutable list, but the
debugger's view grows over the job's lifetime: post steps register
lazily, and the integration layer needs O(1) IStep -> line lookup
at every pause.
This commit adds JobExecutionView, a stateful append-only wrapper
around the renderer. It maintains:
- the current entry list,
- the most recent rendered YAML,
- a Dictionary<IStep, int> for fast line lookup.
Each Append can register an entry in one of three modes:
- with a stepIdentity: registers the IStep -> line mapping
immediately;
- with a matchKey: registers an unclaimed placeholder that a
later TryClaim binds to a real IStep (used when an entry is
predicted before the runner materializes its IStep, e.g. a
Post-step placeholder synthesized at job-init from an action's
metadata);
- with neither: a static informational entry that needs no line
lookup.
This is part 3 of 5. The DAP-integration PR that consumes this
container is the final follow-up.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>