Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to see all elements (level 1) of an array #166

Closed
luxifer opened this issue May 23, 2017 · 7 comments
Closed

Not able to see all elements (level 1) of an array #166

luxifer opened this issue May 23, 2017 · 7 comments

Comments

@luxifer
Copy link

luxifer commented May 23, 2017

PHP version: 7.1.5
XDebug version: v2.5.1
Adapter version: 0.2.0

Your launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "serverSourceRoot": "/vagrant",
            "localSourceRoot": "${workspaceRoot}"
        }
    ]
}

XDebug php.ini config:

zend_extension=xdebug.so
xdebug.var_display_max_depth = 16
xdebug.cli_color = 2
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_host = 10.0.2.2

XDebug logfile (from setting xdebug.remote_log in php.ini): None
Adapter logfile (from setting "log": true in launch.json): None

Code snippet to reproduce: No idea

When I break into some code, vscode tells me a var $order is an array containing 58 elements, but I don't see them all:

capture d ecran 2017-05-23 a 10 38 07

capture d ecran 2017-05-23 a 10 38 20

@felixfbecker
Copy link
Contributor

See xdebugSettings in the readme. This is entirely controlled through XDebug configuration.

@luxifer
Copy link
Author

luxifer commented May 23, 2017

Thanks, it works. But maybe we can increase the default sent to xdebug ? Like the default value in display
IE:

"xdebugSettings": {
    "max_children": 128,
    "max_data": 512,
    "max_depth": 3
}

@felixfbecker
Copy link
Contributor

The default value is determined by XDebug. On slow machines a higher max_children causes a lot of lag, which is why I don't want to change it.

@Eddcapone
Copy link

Where do I have to add the xdebugSettings exactly?

@zobo
Copy link
Contributor

zobo commented Feb 9, 2022

Hi. In launch.json config. Like this:

{
  "configurations": [
    {
      "name": "Listen for Xdebug",
      "type": "php",
      "request": "launch",
      "port": 9003,
      "stopOnEntry": true,
      "log": true,
      "xdebugSettings": {
        "max_children": 128,
        "max_data": 512,
        "max_depth": 3
      }
    },

Please see the main README for details.

@MurzNN
Copy link

MurzNN commented May 11, 2022

Thanks for the workaround! But I wonder, maybe xdebug can dynamically re-request the info about inner variable, when expanding the tree, to go deeper than max_depth level when needed? Or it is not possible in VS Code?

@zobo
Copy link
Contributor

zobo commented May 11, 2022

Hi!
The original question was about max_children. With this setting you can tell Xdebug to return (for example) more array elements. Typical problem, you are inspecting $_SERVER and are not seeing all keys. This is where max_children comes in.
Sadly there is currently no way in VSCode or Debug Adapter Protocol to implement a load more... mechanisem.

The other setting max_depth is something that is already implemented. When inspecting variables, each level is fetched on demand. This was however not true for the eval (Debug Console) and Watch pane because of technical details. I have changed the implementation for Eval (#764) and will also do for Watch in one of the next releases where this will be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants