1- import * as vscode from 'vscode- debugadapter'
2- import { DebugProtocol as VSCodeDebugProtocol } from 'vscode- debugprotocol'
1+ import * as vscode from '@ vscode/ debugadapter'
2+ import { DebugProtocol as VSCodeDebugProtocol } from '@ vscode/ debugprotocol'
33import * as net from 'net'
44import * as xdebug from './xdebugConnection'
55import moment = require( 'moment' )
@@ -377,6 +377,10 @@ class PhpDebugSession extends vscode.DebugSession {
377377 initPacket . engineName === 'Xdebug' &&
378378 semver . valid ( initPacket . engineVersion , { loose : true } ) &&
379379 semver . gte ( initPacket . engineVersion , '3.0.0' , { loose : true } )
380+ const supportedEngine32 =
381+ initPacket . engineName === 'Xdebug' &&
382+ semver . valid ( initPacket . engineVersion , { loose : true } ) &&
383+ semver . gte ( initPacket . engineVersion , '3.2.0' , { loose : true } )
380384 if (
381385 supportedEngine ||
382386 ( ( feat = await connection . sendFeatureGetCommand ( 'resolved_breakpoints' ) ) &&
@@ -398,15 +402,25 @@ class PhpDebugSession extends vscode.DebugSession {
398402 ) {
399403 await connection . sendFeatureSetCommand ( 'extended_properties' , '1' )
400404 }
405+ if (
406+ supportedEngine32 ||
407+ ( ( feat = await connection . sendFeatureGetCommand ( 'breakpoint_include_return_value' ) ) &&
408+ feat . supported === '1' )
409+ ) {
410+ await connection . sendFeatureSetCommand ( 'breakpoint_include_return_value' , '1' )
411+ }
401412
402413 // override features from launch.json
403414 try {
404415 const xdebugSettings = args . xdebugSettings || { }
416+ // Required defaults for indexedVariables
417+ xdebugSettings . max_children = xdebugSettings . max_children || 100
405418 await Promise . all (
406419 Object . keys ( xdebugSettings ) . map ( setting =>
407420 connection . sendFeatureSetCommand ( setting , xdebugSettings [ setting ] )
408421 )
409422 )
423+ args . xdebugSettings = xdebugSettings
410424 } catch ( error ) {
411425 throw new Error (
412426 'Error applying xdebugSettings: ' + ( error instanceof Error ? error . message : error )
@@ -1001,7 +1015,7 @@ class PhpDebugSession extends vscode.DebugSession {
10011015 if ( property . children . length === property . numberOfChildren ) {
10021016 properties = property . children
10031017 } else {
1004- properties = await property . getChildren ( )
1018+ properties = await property . getChildren ( ( args . start ?? 0 ) / 100 )
10051019 }
10061020 } else {
10071021 properties = [ ]
@@ -1066,6 +1080,9 @@ class PhpDebugSession extends vscode.DebugSession {
10661080 presentationHint,
10671081 evaluateName,
10681082 }
1083+ if ( this . _args . xdebugSettings ?. max_children === 100 ) {
1084+ variable . indexedVariables = property . numberOfChildren
1085+ }
10691086 return variable
10701087 } )
10711088 }
0 commit comments