首页 > 解决方案 > 在 VS Code 中调试 PHP - “skipFiles”?

问题描述

我正在尝试在 Visual Studio Code 中调试网站(在 Chrome 中安装了 XDEBUG)。它工作正常,但让我很恼火的是我必须遍历所有文件(比如通过数据库运行的脚本等)

我看到可以在launch.json文件中使用“skipFiles”跳过某些文件,但看起来这只是为了调试Node.js,它还说“不允许使用Property skipFiles”。

    {
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Listen for XDebug",
      "type": "php",
      "request": "launch",
      "port": 9000,
      "skipFiles": [
        "auto_prepend.php",
        "application_top.php",
        "database.php"
      ]
    },
    {
      "name": "Launch currently open script",
      "type": "php",
      "request": "launch",
      "program": "${file}",
      "cwd": "${fileDirname}",
      "port": 9000
    }    
  ]
}

在 VS Code 中调试期间是否有某种方法可以跳过文件?

标签: phpvisual-studio-codexdebug

解决方案


好的,现在我觉得很傻 ;-) 你可以使用 F10 (Step Over) 来不跳出文件。也许有人有同样的问题,他可以读到这个。


推荐阅读