mirror of
https://github.com/actions/runner.git
synced 2026-01-19 02:32:47 +08:00
Include line when stepping back to get to right index
This commit is contained in:
@@ -491,15 +491,9 @@ async function handleStoppedEvent(body) {
|
|||||||
const rawStepName = stripResultIndicator(currentFrame.name);
|
const rawStepName = stripResultIndicator(currentFrame.name);
|
||||||
let stepElement = findStepByName(rawStepName);
|
let stepElement = findStepByName(rawStepName);
|
||||||
|
|
||||||
if (!stepElement) {
|
if (!stepElement && currentFrame.line > 0) {
|
||||||
// Fallback: use step index
|
// Fallback: use step number from Line property (1-indexed, matches data-number)
|
||||||
// Note: GitHub Actions UI shows "Set up job" at index 0, which is not a real workflow step
|
stepElement = findStepByNumber(currentFrame.line);
|
||||||
// DAP uses 1-based frame IDs, so frame ID 1 maps to UI step index 1 (skipping "Set up job")
|
|
||||||
const steps = getAllSteps();
|
|
||||||
const adjustedIndex = currentFrame.id; // 1-based, happens to match after skipping "Set up job"
|
|
||||||
if (adjustedIndex > 0 && adjustedIndex < steps.length) {
|
|
||||||
stepElement = steps[adjustedIndex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stepElement) {
|
if (stepElement) {
|
||||||
@@ -509,7 +503,7 @@ async function handleStoppedEvent(body) {
|
|||||||
// Update step counter
|
// Update step counter
|
||||||
const counter = debuggerPane?.querySelector('.dap-step-counter');
|
const counter = debuggerPane?.querySelector('.dap-step-counter');
|
||||||
if (counter) {
|
if (counter) {
|
||||||
counter.textContent = `Step ${currentFrame.id} of ${stackTrace.stackFrames.length}`;
|
counter.textContent = `Step ${currentFrame.line || currentFrame.id} of ${stackTrace.stackFrames.length}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load scopes
|
// Load scopes
|
||||||
@@ -562,13 +556,9 @@ async function loadCurrentDebugState() {
|
|||||||
const rawStepName = stripResultIndicator(currentFrame.name);
|
const rawStepName = stripResultIndicator(currentFrame.name);
|
||||||
let stepElement = findStepByName(rawStepName);
|
let stepElement = findStepByName(rawStepName);
|
||||||
|
|
||||||
if (!stepElement) {
|
if (!stepElement && currentFrame.line > 0) {
|
||||||
// Fallback: use step index (skip "Set up job" at index 0)
|
// Fallback: use step number from Line property (1-indexed, matches data-number)
|
||||||
const steps = getAllSteps();
|
stepElement = findStepByNumber(currentFrame.line);
|
||||||
const adjustedIndex = currentFrame.id; // 1-based, matches after skipping "Set up job"
|
|
||||||
if (adjustedIndex > 0 && adjustedIndex < steps.length) {
|
|
||||||
stepElement = steps[adjustedIndex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stepElement) {
|
if (stepElement) {
|
||||||
@@ -578,7 +568,7 @@ async function loadCurrentDebugState() {
|
|||||||
// Update step counter
|
// Update step counter
|
||||||
const counter = debuggerPane.querySelector('.dap-step-counter');
|
const counter = debuggerPane.querySelector('.dap-step-counter');
|
||||||
if (counter) {
|
if (counter) {
|
||||||
counter.textContent = `Step ${currentFrame.id + 1} of ${stackTrace.stackFrames.length}`;
|
counter.textContent = `Step ${currentFrame.line || currentFrame.id} of ${stackTrace.stackFrames.length}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load scopes
|
// Load scopes
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ namespace GitHub.Runner.Worker.Dap
|
|||||||
{
|
{
|
||||||
Id = CurrentFrameId,
|
Id = CurrentFrameId,
|
||||||
Name = $"{_currentStep.DisplayName ?? "Current Step"}{resultIndicator}",
|
Name = $"{_currentStep.DisplayName ?? "Current Step"}{resultIndicator}",
|
||||||
Line = 1,
|
Line = _pendingStepIndex + 1, // 1-indexed to match GitHub UI's data-number attribute
|
||||||
Column = 1,
|
Column = 1,
|
||||||
PresentationHint = "normal"
|
PresentationHint = "normal"
|
||||||
});
|
});
|
||||||
@@ -528,7 +528,7 @@ namespace GitHub.Runner.Worker.Dap
|
|||||||
{
|
{
|
||||||
Id = CurrentFrameId,
|
Id = CurrentFrameId,
|
||||||
Name = "(no step executing)",
|
Name = "(no step executing)",
|
||||||
Line = 1,
|
Line = 0,
|
||||||
Column = 1,
|
Column = 1,
|
||||||
PresentationHint = "subtle"
|
PresentationHint = "subtle"
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user