12

When I debug variables in VSCode using Xdebug, the long variables (like SQL sentences) are truncated in the preview mouseover or in the inspection panel.

How I can to see the complete text?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
FelipeR
  • 121
  • 4
  • Did you get an answer on this? I'm fed up with seeing truncated strings and first n items in arrays. Assume it is a setting somewhere perhaps? – CodeCabbie Oct 08 '18 at 11:09
  • 3
    This solved it for me - https://stackoverflow.com/questions/49752153/visual-studio-code-debugging-array-evaluation – CodeCabbie Oct 08 '18 at 11:17
  • Thanks @CodeCabbie that did the trick!! I set `max_data` to `-1` in the launch.json config. – Sir CodesALot Sep 17 '20 at 03:43

1 Answers1

10

I had the same and another problem (hidden children variables and only 32 inner variables were not visible).

Update your launch config (.vscode/launch.json). Set xdebugSettings:

"xdebugSettings": {
    "max_children": 999, // max number of array or object children to initially retrieve.
    "max_depth": 10, // maximum depth that the debugger engine may return when sending arrays, hashs or object structures to the IDE.
    "max_data": 10240 // max length of a string value of an inspected variable. The default value is 1024. So some values can be clipped.
}
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                "/app": "${workspaceFolder}"
            },
            "xdebugSettings": {
                "max_children": 999,
                "max_depth": 10,
                "max_data": 10240
            }
        },
]}

Look at all params: https://github.com/xdebug/vscode-php-debug#supported-launchjson-settings

There are show_hidden and max_data for it.

Sometimes too big values or no limited values in the settings can do deceleration of the system and then the debugging will be stopped.

  • This fixed my issue in VSCode. Already had xdebug.var_display_max_children set in my PHP config but still only got 32 children in VSCode debugging. Thanks! – Jamie Carl Apr 08 '22 at 02:15