title: Better way to debug JS with generators in IntelliJ or WebStorm
body: <p>I am working on a webapp in Node JS, using the Koa framework.</p>
  
  <p>All the flow control is done with generators, instead of callbacks. The code looks sequential, though the actual flow is not. Anyway it looks much cleaner thant callback hell.</p>
  
  <p>Here is a simple example of a controller function written with koa :</p>
  
  <pre><code>function *findUserById(userId)
  {
      var user = yield getUserOrError404(userId);
      yield loadAdditionalData(user);
      yield data.users.save(user);
      return user;
  }
  </code></pre>
  
  <p>Howeve there is one difficulty : stepping through code with <code>yield</code>s in my IDE (IntelliJ IDEA) does not work very well. Once the execution is on the line with the <code>yield</code> statement, if I just "step over", the execution flows goes up the stack to koa code (this is not really the IDE's fault since it just follows the actual flow of execution of the generators, yield statements and Node event loop).</p>
  
  <p>Currently I have to set a breakpoint to the next statement I want the debugger to pause, frequently the next line, and click the "Resume program" button.</p>
  
  <p>It can become tedious when there are more than 2-3 yield statements.</p>
  
  <p>Is there a better way (trick, plugin,...) to step through generator-heavy JS code that allow to step over a yield statement as if it were a "normal" sequential statement ?</p>