Skip to content

Step Into (F11) steps into transpiled JavaScript when debugging TypeScript that uses async/await #4798

Closed
@jpierson

Description

@jpierson
  • VSCode Version: 0.10.11
  • OS Version: Windows 10
  • Node Version: 4.2.2
  • TypeScirpt Version:

Steps to Reproduce:

  1. Set a break point on a line of TypeScript code in an async function that uses the await keyword on the Promise result of another async function. Example: const result = await callMyApi().
  2. Start debugging in VS Code by selecting a related launch profile in a TypScript project. See my example snippet below.
  3. Run necessary code so that the debugger is stopped on the breakpoint from step 1.
  4. Press F11 to step into the callMyApi function.

Expected Result:
The .ts TypeScript file where callMyApi implementation exists should be opened and the debugger should be stopped on the first line of that function.

Actual Result:
The .js transpiled JavaScript file is opened and the debugger is stopped on the first line of the that file.

/// launch.json snippet
{
    "name": "Test",
    "type": "node",
    "request": "launch",
    "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
    "stopOnEntry": false,
    "args": [
        "./bin/test/my.test.js"
    ],
    "cwd": "${workspaceRoot}",
    "runtimeExecutable": null,
    "runtimeArgs": [
        "--lazy",
        "--harmony", "--harmony_modules","--harmony_destructuring"
    ],
    "env": {
        "NODE_ENV": "development"
    },
    "externalConsole": false,
    "sourceMaps": true,
    "outDir": "${workspaceRoot}/bin"
}
// tsconfig.json compiler options snippet
{
    "compilerOptions": {
        "target": "es6",
        "module": "commonjs",
        "sourceMap": true,
        "allowJs": true,
        "outDir": "bin"
    }
   // excludes ...
}

Metadata

Metadata

Assignees

Labels

debugDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions