Skip to content

Commit 7925996

Browse files
committed
dap: do not modify variable references on variables that are zero
Signed-off-by: Jonathan A. Sternberg <[email protected]>
1 parent ebe66f6 commit 7925996

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dap/adapter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,9 @@ func (d *Adapter[C]) Variables(c Context, req *dap.VariablesRequest, resp *dap.V
395395
varRef := req.Arguments.VariablesReference & ((1 << 24) - 1)
396396
resp.Body.Variables = t.Variables(varRef)
397397
for i, ref := range resp.Body.Variables {
398-
resp.Body.Variables[i].VariablesReference = (tid << 24) | ref.VariablesReference
398+
if ref.VariablesReference > 0 {
399+
resp.Body.Variables[i].VariablesReference = (tid << 24) | ref.VariablesReference
400+
}
399401
}
400402
return nil
401403
}

0 commit comments

Comments
 (0)