microsoft / vscode-js-debug

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

Unable to use ${env:USERNAME} in debug.javascript.debugByLinkOptions.sourceMapPathOverrides #818

Closed bartocc closed 4 years ago

bartocc commented 4 years ago

The following setting does not seem to extrapolate ${env:USERNAME}

See https://code.visualstudio.com/docs/editor/variables-reference#_environment-variables for env vars extrapolation

{
  "debug.javascript.debugByLinkOptions": {
    "enabled": "always",
    "sourceMapPathOverrides": {
      "foobar/*": "${workspaceFolder}/lib/${env:USERNAME}/addon/*"
    }
  }
}

VS Code Version: Version: 1.50.1 js-debug-nightly Version: v2020.10.2217

Are we supposed to be able to do that?

connor4312 commented 4 years ago

This works for me. I tested by creating a folder named Connor in my workspace containing a basic create-react-app application. I then set

"debug.javascript.debugByLinkOptions": {
  "enabled": "always",
  "sourceMapPathOverrides": {
    "webpack://?:*/*": "${workspaceFolder}/${env:USERNAME}/*",
    "webpack:///./~/*": "${workspaceFolder}/${env:USERNAME}/node_modules/*",
    "meteor://💻app/*": "${workspaceFolder}/${env:USERNAME}/*"
  }
}

and it worked. Can you describe what you're seeing or share logs?