JavaScript: how to make my IDE hint classes correctly
<p>I'm using Komodo IDE to develop a JavaScript library, but i'd like my IDE to know what types of objects i have and what they do. In particular, i'm trying to solve a problem like this. Consider the following:</p>

<pre><code>NS = {
    Template: {
        Class1: function() { 
            this.arg1 = 0;
        }
    }
}

/**
 * @return {NS/Template/Class1}
 */
function test()
{
    return new NS.Template.Class1();
}

var tmp = test();
tmp. // that should give me a select box with "arg1" present
</code></pre>

<p>But the above example doesn't work. I'm thinking that either i specify the namespace in the @return incorrectly or the IDE doesn't support this at all. The following example is not the way i want to do things, but it works:</p>

<pre><code>NS = {
    Template: {
        /**
         * @type __Class1
         */
        Class1: __Class1 // this is only here for access via NS.*
    }
}

function __Class1()
{
    this.arg1 = 0;
}

/**
 * @return {__Class1}
 */
function test()
{
    return new __Class1();
}

var tmp = test();
tmp. // that does give a select box with "arg1" in it
</code></pre>

<p>Basically what i'm asking is if anyone knows a way of playing with the comments to make the IDE (Komodo if possible) recognize a class within a "namespace". The second example, though works, seems very ugly to me and i wouldn't want to use it.</p>

<p>Thanks for your thoughts</p>
