Skip to content

Commit c61ea3c

Browse files
committed
fix: if watch does not start with $ use eval, extra case for self::
1 parent 942fd4a commit c61ea3c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/phpDebug.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1490,8 +1490,12 @@ class PhpDebugSession extends vscode.DebugSession {
14901490
this.sendResponse(response)
14911491
return
14921492
} else if (args.context === 'watch') {
1493+
// try to translate static variable to special Xdebug format
1494+
if (args.expression.startsWith('self::$')) {
1495+
args.expression = '$this::' + args.expression.substring(7)
1496+
}
14931497
// if we suspect a function call
1494-
if (args.expression.includes('(')) {
1498+
if (!args.expression.startsWith('$') || args.expression.includes('(')) {
14951499
if (stackFrame.level !== 0) {
14961500
throw new Error('Cannot evaluate function calls when not on top of the stack')
14971501
}

0 commit comments

Comments
 (0)