csnover / js-doc-parse

An experimental library for parsing JavaScript files and extracting inline documentation.
31 stars 7 forks source link

inline expansion of union types with kwargs doesn't work #65

Open wkeese opened 11 years ago

wkeese commented 11 years ago

See for example dijit/place.js, which does:

around: function(
    ...
    /*DomNode|place.__Rectangle*/ anchor,
    ...
){

anchor is either DomNode or a dijit/place.Rectangle, and it should list the properties of Rectangle in the API doc either as a nested table or a bullet list (js-doc-parse is in charge of the former).

I tried some defining a local variable called __Rectangle:

/*DomNode|__Rectangle*/ anchor,

but that didn't work either.

wkeese commented 11 years ago

The workaround is to specify the type as a MID+property, like this:

/*DomNode|dijit/place.__Rectangle*/ anchor,

Then it turns into a hyperlink to a separate page w/the definition for that type.

I did the workaround, so this isn't critical.

neonstalwart commented 11 years ago

e8d05e3 in #80 would fix this. #82 has an explanation.