Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I unable to debug my vscode extension?

I've been unable to debug an extension I'm making for vscode. This is even happening even on a fresh install of the latest Insiders build, with the default settings and extensions.

I've tried the following tools in both the project window and the testing window that is running the extension [Extension Development Host].

  • View: Toggle Debug Console
    • Variables
    • Call Stack
  • View: Show Run and Debug
  • View: Toggle Output
    • Log (Extension Host)
  • Developer: Toggle Developer Tools
    • Console
    • Issues

Despite this, I can't see any error information. I can only see my console.log messages in the Debug Console of the project window, and also in the Developer Tools Console of the testing window.

Here is my launch.json file:

{
    "version": "0.1.0",
    "configurations": [{
        "name": "Launch Extension",
        "type": "extensionHost",
        "request": "launch",
        "runtimeExecutable": "${execPath}",
        "args": ["--extensionDevelopmentPath=${workspaceRoot}"]
    }]
}

1 Answers

Make sure to enable sourceMaps. They allow you to link your TypeScript code to your JavaScript code. Also, you can use version 0.2.0 now.

  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Extension",
      "type": "extensionHost",
      "request": "launch",
      "runtimeExecutable": "${execPath}",
      "args": ["--extensionDevelopmentPath=${workspaceRoot}"],
      "sourceMaps": true,
      "outFiles": ["${workspaceRoot}/dist/**/*.js"]
    },
like image 154
Charles Avatar answered Jan 31 '26 09:01

Charles



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!