Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] JSDoc limitations

Hi Sandro,

I am not sure if you heard of VJET _javascript_ Toolkit it is moving to the eclipse foundation (http://www.eclipse.org/proposals/webtools.vjet/) and currently handles some of the cases you mentioned below. We are in the process of moving so you can use the current vjet web page to learn more ... https://www.ebayopensource.org/index.php/VJET/HomePage


Here is your first case:


var foo = {
    bar : 24
};

yields this outline:


// nested example

var foo = {
    bar : 24
    ,zot: {
    goo: "test",
    zot2: {
    yummy:new Date()
    }
    }
};


As far as JSDoc examples... currently VJET supports VJETDoc (https://www.ebayopensource.org/wiki/display/VJET/VJETDoc) a way to annotate any _expression_ in js and the VJET vjo library can be used to model higher level typing in JS such as class, enum, interfaces. 

vjo.ctype('namespace.foo') //< public
.props({
//> public Number
bar:24
})
.endType();

yields this outline. the memberOf annotation is not needed since VJET understands the function closures create the class. 


For the baz.foo example this one I am not sure what you are trying to do.  Where is the definition of baz is it a global? 

For library support... There is a nodejs type library and basic Ext type library available which provides more library support. Sencha is also holding a private beta where they have extended VJET to understand the Ext.define and Ext.create semantics. 


Thanks,

Justin



On Aug 22, 2012, at 8:13 AM, Sandro <redsandro@xxxxxxxxx> wrote:

After some advice here I tried to get object-literal type declarations to outline more specific and offer code-complete using JSdoc, but Eclipse seems to be deaf for anything except the @memberOf tag.

1st, with

var foo = {
    bar : 24
};

you get a variable outlined.

With

/** @public @static @class someclass */
var foo = {
    bar : 24
};

you still get a variable.

With

var foo = {
    /** @memberOf foo */
    bar : 24
};

THEN you get a function/type.

Is WTP's JsDoc ignoring previous tags?

2nd, more importantly, expanding externally existing objects (e.g. baz) (because frameworks like nodejs or extjs provide them and they are pretty much where all your code is, so without @memberOf nothing at all will be outlined) like so:

baz.foo = {
    bar : 24
};

only works when manually adding /** @memberOf baz.foo */ otherwise it will not be outlined at all.
(I think this should work automatically.)

and 3rd, strangely, after using @memberOf to outline the parent, the parent (baz.foo) will become available in other _javascript_ files within the same project, but the parent's childs (baz.foo.bar) do not. Can these also be externally exported through JSdoc tags?

~Redsandro _______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev


Back to the top