title: Javascript Intellisense not showing everything
body: <p><strong>Brainstorming needed</strong>. I have a problem with Javascript libraries (jQuery, ExtJS etc.) that don't seem to play well along with Javascript Intellisense built in Visual Studio 2008. They provide certain utility helper functions that intellisense fails to understand.</p>
  
  <p>ie. ExtJS code</p>
  
  <pre><code>// convenience function to create namespace object placeholders
  Ext.namespace("Root.Sub.Subsub");
  </code></pre>
  
  <p>or jQuery</p>
  
  <pre><code>// doing the same thing in jQuery
  $.extend(window, {
     Root: {
        Sub: {
           Subsub: {}
        } 
     },
  });
  </code></pre>
  
  <p>or even (I pitty thou that shalt maintain this code)</p>
  
  <pre><code>$.extend(window, { Root: {}});
  $.extend(Root, { Sub: {}});
  $.extend(Root.Sub, { Subsub: {}});
  </code></pre>
  
  <p>The end result of these calls is basically the same. <strong>None of them would make <code>Root</code> namespace visible to Javascript Intellisense</strong> in Visual Studio 2008. If we would know how intellisense works under the hood we could probably be able to overcome this situation.</p>
  
  <p>Is it possible to <em>convince</em> Intellisense to display/recognise these namespaces, without writing objects directly like:</p>
  
  <pre><code>Root = {
     Sub: {
        Subsub: {}
     }
  };
  </code></pre>
  
  <p>I admit that the first jQuery call is quite similar to this one, but it's better to use extend functionality to prevent removing/overwriting existing functionality/namespaces.</p>
  
  <h2>Question</h2>
  
  <p><strong>How should we use these utility functions to make Intellisense work?</strong><br>
  Any brainstorming answer that would shed some light on this is welcome?</p>
  
  <h2>Edit</h2>
  
  <p>I've found out that namespaces created with utility functions are shown if they are defined outside (ie. in a different script file) and you make a reference to that file like:</p>
  
  <pre><code>/// &lt;reference path="different.script.file.js" /&gt;
  </code></pre>
  
  <p>In this case everything's fine. But if you call utility functions within the same file, they're not listed in intellisense drop down list.</p>