Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317928

Summary: [language support] JSDoc3 Interface Support (@interface & @implements)
Product: [WebTools] JSDT Reporter: Dominic Chambers <dominic.chambers>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: enhancement    
Priority: P3 CC: dominic.chambers, harry.willis
Version: unspecifiedKeywords: plan
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Interface test case none

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.