2

I'm using a step debugger to debug my code.

I have a json string stored in $x and I need to copy the value. But the value is not showing completly, it just shows half of it, so I can't copy it.

enter image description here

Is there a way to solve it without a workaround e.g. write the value into a file?


Tested with VSC 1.68.1

starball
  • 20,030
  • 7
  • 43
  • 238
Black
  • 18,150
  • 39
  • 158
  • 271
  • Did you try to right-click on the variable and choose "Copy value"? – Dorin Botan Jun 22 '22 at 13:02
  • 1
    This is probably the number one gripe I have for VS Code. Maybe things have changed, or I just failed to find a way. Maybe see if these posts help: https://stackoverflow.com/questions/59756331/how-to-show-the-entire-value-in-vscode-debug-mode https://stackoverflow.com/questions/57764639/how-to-stop-vs-code-from-truncating-python-data-in-the-console https://stackoverflow.com/questions/55223462/vs-code-truncates-variables-when-debugging – Timothy G. Jun 22 '22 at 13:06
  • @DorinBotan I actually think if you do that, it will copy up to the `...` part - very annoying. – Timothy G. Jun 22 '22 at 13:07
  • @DorinBotan, yes, it does copy half of the value. – Black Jun 22 '22 at 13:10
  • 1
    @Black This seems Xdebug related then. Did you try this: https://stackoverflow.com/questions/68291170/show-long-strings-in-vs-code-when-working-with-php-xdebug – Dorin Botan Jun 22 '22 at 13:15
  • @DorinBotan, thank you, that solved it! I also had stop the debugger and start it again to make it load the change I made in the launch.json! – Black Jun 22 '22 at 13:24
  • @DorinBotan pls add your solution as an answer – Black Jun 23 '22 at 08:52
  • Does this answer your question? [Show long strings in VS Code when working with PHP + XDEBUG](https://stackoverflow.com/questions/68291170/show-long-strings-in-vs-code-when-working-with-php-xdebug) – starball Aug 28 '23 at 09:31

1 Answers1

0

The solution can be found here.

Just add this:

        "xdebugSettings": {
            "max_children": 128,
            "max_data": -1,
            "max_depth": 3
        },

to your .vscode/launch.json

Black
  • 18,150
  • 39
  • 158
  • 271