【问题标题】:Xdebug for VSCode truncates long variables in previewVSCode 的 Xdebug 在预览中截断长变量
【发布时间】:2018-09-05 23:46:49
【问题描述】:

当我在 VSCode 中使用 Xdebug 调试变量时,长变量(如 SQL 语句)在预览鼠标悬停或检查面板中被截断。

我怎样才能看到完整的文本?

【问题讨论】:

  • 你得到这个答案了吗?我厌倦了看到截断的字符串和数组中的前 n 个项目。假设它可能是某个地方的设置?
  • 感谢@CodeCabbie 成功了!!我在 launch.json 配置中将max_data 设置为-1

标签: php variables visual-studio-code xdebug truncate


【解决方案1】:

我遇到了同样的问题和另一个问题(隐藏的子变量,只有 32 个内部变量不可见)。

更新您的启动配置 (.vscode/launch.json)。设置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
            }
        },
]}

查看所有参数:https://github.com/xdebug/vscode-php-debug#supported-launchjson-settings

show_hiddenmax_data

有时设置的值太大或没有设置限制值会使系统减速,然后停止调试。

【讨论】:

  • 感谢@oleg-dmitrochenko。
猜你喜欢
  • 2017-07-07
  • 2014-01-24
  • 2021-03-16
  • 1970-01-01
  • 2023-03-24
  • 2017-09-07
  • 1970-01-01
  • 2021-06-29
  • 1970-01-01
相关资源
最近更新 更多