Bug 317928 - [language support] JSDoc3 Interface Support (@interface & @implements)
Summary: [language support] JSDoc3 Interface Support (@interface & @implements)
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement with 4 votes (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2010-06-25 04:23 EDT by Dominic Chambers CLA
Modified: 2014-05-29 13:51 EDT (History)
2 users (show)

See Also:


Attachments
Interface test case (603 bytes, text/plain)
2010-06-25 04:25 EDT, Dominic Chambers CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Chambers CLA 2010-06-25 04:23:18 EDT
Build Identifier: 20100603-0907

Interface support is scheduled to become a standard feature of jsdoc toolkit from version 3, and has been implemented by some in the meantime using custom tags:

  http://code.google.com/p/jsdoc-toolkit/issues/detail?id=229

Support for Javscript 'interfaces' can be trivially added to Eclipse by doing the following:

  1. Make @interface a synonym for @class
  2. Make @implements a synonym for @extends


Reproducible: Always
Comment 1 Dominic Chambers CLA 2010-06-25 04:25:02 EDT
Created attachment 172722 [details]
Interface test case
Comment 2 domcap CLA 2010-09-10 06:12:00 EDT
Hi Nitin,

Any news on this? It seems like it should be a really quick win.

Thanks, Dominic.
Comment 3 domcap CLA 2010-09-29 05:01:48 EDT
Perhaps somebody else is able to comment on this bug instead?
Comment 4 harry.willis CLA 2010-10-08 08:57:12 EDT
This would be a huge win for us, and is stopping our javascript content assistence working for the majority of our code.
Comment 5 Nitin Dahyabhai CLA 2010-10-27 21:18:11 EDT
There is more to it than simply treating the new tags like the old ones, isn't there?  The issue in comment 0 implies we should actually treat the properties differently while populating interfaces.
Comment 6 domcap CLA 2010-10-28 05:38:14 EDT
Hi Nitin,

What extra requirements are you referring to from comment 0? I've just read through the all the comments from the jsdoc-toolkit site and can't see any new requirements there. There was somebody who misunderstood how to create static methods in general, and conflated that issue with interface support, but that's all I can see that you might be referring to.

I can certainly see that it would be possible to 'gold plate' this feature by treating interfaces specially, for example:

 * you might decide that new Interface() is an error
 * you might display an error if the user doesn't implement all the methods of an interface they claim to have implmented, 

However, in reality, I think both of these restrictions would actually be anti-features for most Javascript code bases. We for example throw an UnimplementInterfaceMethod exception in interface methods that clients have to implement, but don't bother for optional methods that don't have to be implemented, and so this restriction would force clients to create lot's of empty stub methods just to keep Eclipse happy.

IMO, just treating these new tags as synonyms for classes will almost always be the right thing to do since they are just classes anyway. Again, if there's a requirement I'm missing here then I'd love to here about it so I can better understand the problem.

Thanks, Dominic.