title: An internal error occurred during: "Requesting JavaScript AST from selection"
body: <p>I'm facing unique error/alert-popup while editing JavaScript files in Eclipse and it pops up this error every time I place the cursor on that line. </p>
  
  <p>JS: NullPointerException when cursor is placed at the end of the line containing return statement.</p>
  
  <pre><code>foo.bar = function(x) {
      if (xyz) {
        return fn(x);«error»
      }
  
      return fn(x);«error»
  
      return (fn(x));«error»
  
      return new fn(x);«ok»
  
      return x;«sometimes»
  
      return "";«error» 
  
      return x+"x";«error» 
  
      return this.x;«error»
  
      return fn(
          x);«error»
  
      return new fn(
          x);«ok»
  
      return;«error»  
  };
  </code></pre>
  
  <ul>
  <li>«» — cursor position</li>
  <li>«ok» — no error</li>
  <li>«error» — triggers error  </li>
  <li>«sometimes» — I have code that never triggers an exception in that case, but I don’t see a pattern.</li>
  </ul>
  
  <p>If cursor is at the end of the line of a return, this exception happens:</p>
  
  <pre><code>An internal error occurred during: "Requesting JavaScript AST from selection".
  java.lang.NullPointerException
  </code></pre>
  
  <p>The Eclipse error is:</p>
  
  <pre><code>'Requesting JavaScript AST from Selection' has encountered a problem. 
  An internal error occured during "Requesting JavaScript AST from selection". 
  java.lang.NullPointerException
  </code></pre>
  
  <p>Is there a solution or workaround available to fix the problem?</p>