删除VS Code PHPDebug中的字符限制 [英] Remove character limit in VS Code PHPDebug

查看:89
本文介绍了删除VS Code PHPDebug中的字符限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PHP中调试并使用左侧的变量窗格时,将鼠标悬停在该变量/对象上时可以看到的字符数是有限制的。

When debugging in PHP and using the variables pane on the left, there is a limit to the amount of characters you can see for that variable/object when hovering over.

是否有必要查看该变量的全部有效负载,或者每次我想查看较大的变量值时都不必使用 file_put_contents 以外的其他方法?同样将变量打印到调试控制台也有相同的限制,但是增加了一个额外的字符(幸运的是我)。

Is there anyway to see the full payload for that variable or any work around other than having to use file_put_contents every time I want to see a large variable value? Also printing the variable to the debug console has the same limitation but adds one extra character (lucky me).

推荐答案

实现您需要在VS Code中更改xdebug的 launch.json 配置。

In order to achieve that you need to make a change in your launch.json configuration of xdebug in VS Code.

您需要添加到配置中的那部分配置 launch.json 的值是 xdebugSettings:{ max_data:-1}

The piece of configuration you will need to add to your configuration of launch.json is "xdebugSettings": { "max_data": -1 }

简单的配置应如下所示:

A simple configuration should look like that

{
"version": "0.2.0",
"configurations": [
    {
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9000,
        "serverSourceRoot": "/var/www/myapp/",
        "localSourceRoot": "${workspaceRoot}/",
        "xdebugSettings": {
            "max_data": -1
        }
    }]
}

xdebugSettings.max_data
控制显示变量时显示的最大字符串长度。要禁用任何限制,请使用-1作为值。

xdebugSettings.max_data Controls the maximum string length that is shown when variables are displayed. To disable any limitation, use -1 as value.

祝您好运。

这篇关于删除VS Code PHPDebug中的字符限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆