Is it possible to define a custom inheritance method?

At my work we use a method like

utils.implement(ExtendingClass, BaseClass);

Is there a way to tell intellij to treat this the same way as

function BaseClass() {}

function ExtendingClass() {}

ExtendingClass.prototype = new BaseClass();

?

Cheers,
Pete

3 comments
Comment actions Permalink

Surely we aren't the only people wanting this. If you think this would be an awesome feature, why not say so in this thread.

0
Comment actions Permalink

I suppose you're talking about Javascript, at least that would be a reasonable thing to ask for that language support.

As far as I can tell, IDEA is already picking up this way of defining inheritance. At least it does that for me (i.e. I can see inherited members in the outline) when I use extjs and their Ext.extend(subclass, superclass) method. You might want to have a look at their implementation and see whether you can make IDEA understand your method for inheritance, too.
Of course, it might be that the JetBrains guys coded something up to understand only ExtJs's (and maybe some other frameworks') inheritance mechanisms and then you'd probably have to use one of those libs until the IDEA devs change the implementation.

HTH,
Denis

0
Comment actions Permalink

Please, file JIRA request

ProggerPete wrote:

At my work we use a method like

utils.implement(ExtendingClass, BaseClass);

Is there a way to tell intellij to treat this the same way as

function BaseClass() {}

function ExtendingClass() {}

ExtendingClass.prototype = new BaseClass();

?

Cheers,
Pete

---
Original message URL: http://www.jetbrains.net/devnet/message/5239128#5239128



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

Please sign in to leave a comment.