如何配置 xdebug stacktrace 以链接到 VS Code 中的文件并打开文件

Gre*_*aun 4 php xdebug visual-studio-debugging visual-studio-code

当 xdebug 提供堆栈跟踪时,它可以创建链接以在文本编辑器中的特定行打开文件。例如,如果安装了 subl 处理程序,以下配置将在 Sublime 中打开文件:

xdebug.file_link_format="subl://open?url=%f&line=%l"
Run Code Online (Sandbox Code Playgroud)

如何为 VS Code 设置 file_link_format?

Gre*_*aun 5

这是VS Code 的 URL 格式的文档。

因此,xdebug 配置是:

xdebug.file_link_format="vscode://file/%f:%l"
Run Code Online (Sandbox Code Playgroud)