microsoft / vscode

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

Problems pane gives incorrect advice about `launch.json`. #171446

Open Stanzilla opened 1 year ago

Stanzilla commented 1 year ago

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

Steps to Reproduce:

{
  // 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": "Debug Main Process",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
      "windows": {
        "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
      },
      "runtimeArgs": [
        "--remote-debugging-port=9229",
        "."
      ],
      "envFile": "${workspaceFolder}/.vscode/.debug.env",
      "console": "integratedTerminal"
    },
    {
      "name": "Debug Renderer Process",
      "port": 9229,
      "request": "attach",
      "type": "chrome",
      "timeout": 60000,
      "skipFiles": [
        "<node_internals>/**",
        "${workspaceRoot}/node_modules/**",
        "${workspaceRoot}/dist-electron/**",
        // Skip files in host(VITE_DEV_SERVER_URL)
        "http://127.0.0.1:3344/**"
      ]
    },
  ],
  "compounds": [
    {
      "name": "Debug App",
      "preLaunchTask": "Before Debug",
      "configurations": [
        "Debug Main Process",
        "Debug Renderer Process"
      ],
      "presentation": {
        "hidden": false,
        "group": "",
        "order": 1
      },
      "stopAll": true
    }
  ],
}
  1. Use provided launch.json
  2. Open it in VSC

image

In this case, it is suggested that I add name, type and request fields to the windows section, which does not work and is documented here https://code.visualstudio.com/docs/editor/debugging#_platformspecific-properties

gjsjohnmurray commented 1 year ago

Looks like this previously came up in #126585 and got fixed in https://github.com/microsoft/vscode/commit/f1330007e489703cd680d30820a46dce6f7b74be by @isidorn removing attributes.additionalProperties = false;

Then in https://github.com/microsoft/vscode/commit/b0c5a282e53fb4c1eb138b9bff0f8e8c169592e1 @roblourens reinstated attributes.additionalProperties = false; as part of a fix for https://github.com/microsoft/vscode/issues/142642

roblourens commented 1 year ago

Thanks @gjsjohnmurray, I think I want the defaults to apply to the parent but not the platform override section, I probably have to do something different with the ref