Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging TypeScript: Step over/into inside async functions #26579

Closed
robbie-cahill opened this issue May 13, 2017 · 2 comments
Closed

Debugging TypeScript: Step over/into inside async functions #26579

robbie-cahill opened this issue May 13, 2017 · 2 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@robbie-cahill
Copy link

robbie-cahill commented May 13, 2017

I have a node app written in TypeScript, launched with node.

I've set up Debugging as per the docs, and it works perfectly for non-async functions. I can step over, step into, step out etc.

However, this changes when I go into an async function. "Step over" takes me to the compiled javascript. To work around this I have to set multiple breakpoints to run my code line by line.

  • VSCode Version: 1.12.1
  • OS Version: Linux

Steps to Reproduce:

  1. Set up debugging for a node TypeScript project
  2. Create an async function and set a breakpoint.
  3. Step over. Also try Stepping into function calls.

test code (test.ts):

class Test { 
     test(): any {
         //debugging, step over/step into will work fine in this method
         let a = 'b';
         let b = 'c';
         this.testa();
     }
     async testa(): any {
         let a = 'b';
         let b = 'c';
         await this.testb(); //Try step into/step over here
         let c = 'd';

        return new Promise<void>(function(resolve) {
            
        });
     }
     async testb(): Promise<any> {
           let a = 'b';
           let b = 'c'; 

        return new Promise<void>(function(resolve) {
            
        });
     }
}

let test = new Test();
test.test();
@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues *question Issue represents a question, should be posted to StackOverflow (VS Code) labels May 13, 2017
@reverofevil
Copy link

reverofevil commented Jun 2, 2017

@weinand This is not a question, this is a third duplicate of the same bug: #19973, #11645.

@weinand
Copy link
Contributor

weinand commented Jun 2, 2017

dup of #11645

@weinand weinand closed this as completed Jun 2, 2017
@weinand weinand removed the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Jun 2, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

3 participants