Skip to content

Commit 477b6fd

Browse files
committed
Revert watch property get to eval with eval_cache.
1 parent 050eddc commit 477b6fd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/phpDebug.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ class PhpDebugSession extends vscode.DebugSession {
14751475
if (res.property) {
14761476
result = res.property
14771477
}
1478-
} else if (args.context === 'repl' || args.context === 'watch') {
1478+
} else if (args.context === 'repl') {
14791479
const uuid = randomUUID()
14801480
await connection.sendEvalCommand(`$GLOBALS['eval_cache']['${uuid}']=${args.expression}`)
14811481
const ctx = await stackFrame.getContexts() // TODO CACHE THIS
@@ -1489,6 +1489,14 @@ class PhpDebugSession extends vscode.DebugSession {
14891489
response.body = { result: await varExportProperty(res.property), variablesReference: 0 }
14901490
this.sendResponse(response)
14911491
return
1492+
} else if (args.context === 'watch') {
1493+
const uuid = randomUUID()
1494+
await connection.sendEvalCommand(`$GLOBALS['eval_cache']['watch']['${uuid}']=${args.expression}`)
1495+
const ctx = await stackFrame.getContexts() // TODO CACHE THIS
1496+
const res = await connection.sendPropertyGetNameCommand(`$eval_cache['watch']['${uuid}']`, ctx[1])
1497+
if (res.property) {
1498+
result = res.property
1499+
}
14921500
} else {
14931501
const res = await connection.sendEvalCommand(args.expression)
14941502
if (res.result) {

0 commit comments

Comments
 (0)