VSCode 的 Xdebug 在预览中截断长变量

Fel*_*peR 7 php variables truncate xdebug visual-studio-code

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

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

Ole*_*nko 10

我有同样的问题和另一个问题(隐藏的子变量和只有 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.
}
Run Code Online (Sandbox Code Playgroud)
{
    "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
            }
        },
]}
Run Code Online (Sandbox Code Playgroud)

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

有且show_hidden为之max_data

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