fix indexing

This commit is contained in:
Francesco Renzi
2026-01-16 01:05:30 +00:00
parent 82e35c0caa
commit ebdf081671

View File

@@ -492,8 +492,9 @@ async function handleStoppedEvent(body) {
let stepElement = findStepByName(rawStepName); let stepElement = findStepByName(rawStepName);
if (!stepElement && currentFrame.line > 0) { if (!stepElement && currentFrame.line > 0) {
// Fallback: use step number from Line property (1-indexed, matches data-number) // Fallback: use step number from Line property
stepElement = findStepByNumber(currentFrame.line); // Add 1 to account for "Set up job" which is always step 1 in GitHub UI but not in DAP
stepElement = findStepByNumber(currentFrame.line + 1);
} }
if (stepElement) { if (stepElement) {
@@ -557,8 +558,9 @@ async function loadCurrentDebugState() {
let stepElement = findStepByName(rawStepName); let stepElement = findStepByName(rawStepName);
if (!stepElement && currentFrame.line > 0) { if (!stepElement && currentFrame.line > 0) {
// Fallback: use step number from Line property (1-indexed, matches data-number) // Fallback: use step number from Line property
stepElement = findStepByNumber(currentFrame.line); // Add 1 to account for "Set up job" which is always step 1 in GitHub UI but not in DAP
stepElement = findStepByNumber(currentFrame.line + 1);
} }
if (stepElement) { if (stepElement) {