microsoft / vscode-js-debug

A DAP-compatible JavaScript debugger. Used in VS Code, VS, + more
MIT License
1.67k stars 283 forks source link

Support "debug url" in terminals created through the `node-terminal` launch type #2049

Closed WittonBell closed 3 months ago

WittonBell commented 3 months ago

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

Steps to Reproduce:

  1. create a t directory
  2. open t with VSCode
  3. run npm init in terminal of VSCode, the package.json use following configure:
    {
    "name": "t",
    "version": "1.0.0",
    "main": "index.js",
    "scripts": {
    "dev": "echo http://127.0.0.1:5173"
    }
    }
  4. create .vscode/launch.json and add configuration with run "npm start" in a debug terminal

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "command": "npm run dev",
            "name": "Run npm start",
            "request": "launch",
            "type": "node-terminal"
        }
    ]
}
  1. Press F5 run Run npm start configuration
  2. move mouse on http://127.0.0.1:5173 in terminal output, hover show Follow link(crtl + click), but Debug URL(crtl + click) expected. Open JavaScript Debug Terminal, run npm run dev, http://127.0.0.1:5173 hover show Debug URL(crtl + click).

There doesn't seem to be a way to configure launcher.json and start debugging URL. Currently, the closest way is to configure with run "npm start" in a debug terminal, but it only follow the URL, not starts debugging mode. So it could be a bug.

vs-code-engineering[bot] commented 3 months ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.92.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!