FelipeR
FelipeR

Reputation: 141

Xdebug for VSCode truncates long variables in preview

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?

Upvotes: 14

Views: 3311

Answers (1)

Oleg Dmitrochenko
Oleg Dmitrochenko

Reputation: 579

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.

Upvotes: 15

Related Questions