title: How can I get auto-completion in IntelliJ 12.1.4 work with JavaScript CommonJS
body: <p>In our current JavaScript project (HTML5 application) we are using a global namespace tree, i.e.</p>
  
  <pre><code>nsBase = nsBase || {};
  nsBase.sub1 = nsBase.sub1 || {};
  ...
  </code></pre>
  
  <p>And then each class, in a dedicated file, hooks up into this namespace tree. Auto-completion can resolve them all across the project, together with parameter info and so forth.</p>
  
  <p>We would like to get rid of the global namespace objects and introduce CommonJS format (and concatenate with browserify). But more important to that, any result returned by the require() calls should still allow auto-completion to work.</p>
  
  <p>I found the Node.js plugin (<a href="http://plugins.jetbrains.com/plugin/?id=6098" rel="nofollow">http://plugins.jetbrains.com/plugin/?id=6098</a>), but, after installing and enabling it for the project, it would only work for Node.js modules (e.g. 'fs') - For own files, the auto-complete would only propose 'exports' (as in module.exports).</p>
  
  <p>Furthermore, I'd rather not like to enable all Node.js globals for the HTML5 targeted app, all we need is the knowledge of module.exports, require() and the corresponding logic behind it.</p>
  
  <p>To the questions:</p>
  
  <ul>
  <li>Did I do something wrong and it should work with the plugin?</li>
  <li>Would there be a specific solution, just for the CommonJS format?</li>
  </ul>