title: Visual Studio 2010 Javascript Intellisense not working properly
body: <p>There's a little problem with Visual Studio 2010 and Javascript Intellisense.</p>
  
  <p>I've implemented a class with some "Properties" and want to implement a "static" function, which returns a new instance of the class after an ajax-request which returns a Json-Object. </p>
  
  <p>Like so:</p>
  
  <pre><code>/// &lt;reference path="jQuery/jquery-1.4.1-vsdoc.js" /&gt;
  MyClass = function (options) {
      /// &lt;summary&gt;MyClass Description&lt;/summary&gt;
      /// &lt;param name="options" type="Array"&gt;Foo1 (string), Foo2(string)&lt;/param&gt;
      /// &lt;field name="Foo1" type="String"&gt;Foo1 Description&lt;/field&gt;
      /// &lt;field name="Foo2" type="String"&gt;Foo2 Description&lt;/field&gt;
  
      // [...] Some Code
  
      // Properties
      this.Foo1 = options.Foo1;
      this.Foo2 = options.Foo2;
  }
  </code></pre>
  
  <p>And the function:</p>
  
  <p>intellisense not working:</p>
  
  <pre><code>MyClass.MyFunction = function () { 
      /// &lt;summary&gt;MyFunction Description&lt;/summary&gt;
      /// &lt;returns type="MyClass"&gt;MyClass&lt;/returns&gt;
  
      $.ajax({
          type: 'GET',
          url: '/Foo/Bar',
          dataType: 'json',
          success: function (result) {
              return new MyClass(result);
          }
      });
  }
  </code></pre>
  
  <p>intellisense working:</p>
  
  <pre><code>MyClass.MyFunction = function () { 
      /// &lt;summary&gt;MyFunction Description&lt;/summary&gt;
      /// &lt;returns type="MyClass"&gt;MyClass&lt;/returns&gt;
  
      var foo = new MyClass({'foo1': 'a', 'foo2': 'b'});
      $.ajax({
          type: 'GET',
          url: '/Foo/Bar',
          dataType: 'json',
          success: function (result) {
              foo = new MyClass(result);
              return foo;
          }
      });
  
      return foo;
  }
  </code></pre>
  
  <p>When I call the function from another function, like:</p>
  
  <pre><code>$(document).ready(function() {
      var foobar = MyClass.MyFunction(); // returns Object of type "MyClass"
      alert(foobar.Foo1); // At this Point, the intellisense doesn't work correct
  });
  </code></pre>
  
  <p>my intellisense isn't working anymore (or works with the double-return), because the return of MyFunction is within the ajax-request. If I place the return at the end of the function, the intellisense is working again. But in this case I have two returns. The first from the function and the second from the ajax-success.</p>
  
  <p>It seems that the <code>&lt;returns...&gt;&lt;/returns&gt;</code> only works when the return is at the end of the function. That's bad, because I just need one return when the ajax-request is completed.</p>
  
  <p>I don't know how to deal with this problem. Hope you can help me to fix this :)</p>