Skip to content

Commit 378baab

Browse files
jonyofelixfbecker
authored andcommitted
fix: set evaluateName for variables to allow copy (#295)
This sets `evaluateName` on the variable object passed back to vscode. I guess this is something from a newer version of vscode because I remember the copy used to work. It sets it to `fullName` for the property if available (which will be something like `$var->property` if it is for a child), or `name` otherwise, which will be for top level variables. Fixes #278
1 parent 6fc30ef commit 378baab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/phpDebug.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ class PhpDebugSession extends vscode.DebugSession {
835835
variables = properties.map(property => {
836836
const displayValue = formatPropertyValue(property)
837837
let variablesReference: number
838+
let evaluateName: string
838839
if (property.hasChildren || property.type === 'array' || property.type === 'object') {
839840
// if the property has children, we have to send a variableReference back to VS Code
840841
// so it can receive the child elements in another request.
@@ -848,11 +849,17 @@ class PhpDebugSession extends vscode.DebugSession {
848849
} else {
849850
variablesReference = 0
850851
}
852+
if (property instanceof xdebug.Property) {
853+
evaluateName = property.fullName
854+
} else {
855+
evaluateName = property.name
856+
}
851857
const variable: VSCodeDebugProtocol.Variable = {
852858
name: property.name,
853859
value: displayValue,
854860
type: property.type,
855861
variablesReference,
862+
evaluateName,
856863
}
857864
return variable
858865
})

0 commit comments

Comments
 (0)