microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.89k stars 29.52k forks source link

Debugging doesn't respect skipFiles #227431

Open andrecasal opened 2 months ago

andrecasal commented 2 months ago

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. git clone https://github.com/epicweb-dev/epic-stack
  2. npm i
  3. Add this launch.json config:
    {
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node-terminal",
            "presentation": {
                "hidden": true,
                "group": "debug",
                "order": 2
            },
            "cascadeTerminateToConfigurations": [
                "Frontend"
            ],
            "name": "Backend",
            "request": "launch",
            "command": "npm run dev",
            "sourceMaps": true,
            "smartStep": true,
            "skipFiles": [
                "<node_internals>/**",
                "${workspaceFolder}/node_modules/**",
                "${workspaceFolder}/build/**",
                "${workspaceFolder}/server-build/**",
            ],
        },
        {
            "type": "chrome",
            "presentation": {
                "hidden": true,
                "group": "debug",
                "order": 3
            },
            "cascadeTerminateToConfigurations": [
                "Backend"
            ],
            "name": "Frontend",
            "request": "launch",
            "url": "http://localhost:3000/",
            "webRoot": "${workspaceFolder}/app",
            "sourceMaps": true,
            "smartStep": true,
            "skipFiles": [
                "<node_internals>/**",
                "${workspaceFolder}/node_modules/**",
            ]
        },
    ],
    "compounds": [
        {
            "name": "Debug",
            "presentation": {
                "hidden": false,
                "group": "debug",
                "order": 1
            },
            "configurations": [
                "Backend",
                "Frontend"
            ]
        }
    ]
    }
  4. Set a breakpoint anywhere in /app/root.tsx's loader Screenshot 2024-09-03 at 11 41 14
  5. Start debug session and step over to the end of the loader.

You'll notice that server-build loads, even though the debug config asks to skip files inside node_modules, build, and server-build.

https://github.com/user-attachments/assets/ee11793e-3686-4da5-b935-ced19ce98b60

Robstei commented 1 week ago

In my setup with remote debugging inside docker skipFiles did not work either when i used

 "skipFiles": [
        "${workspaceFolder}/node_modules/**"
  ],

It worked after changing it to

 "skipFiles": [
        "**/${workspaceFolder}/node_modules/**"
  ],

The behavior is the same when using the actual path for the workspace folder instad of ${workspaceFolder}