Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Aranir

Good Day

I come from a php background and started to use Impact for a few days now.
One thing i would like to be able to do is to define the type of the variable for code completion hints (I use php storm for coding).

In php this works in the following way:

/**@var $cell EntityCell */

Is anything similar possible in javascript and with the ig.Class extened classes of impact?

Thank you for any hint

1 decade ago by Joncom

When you say hinting, do you mean where your IDE gives you hints on what variables go where, and tells a description of each?

If so, Komodo IDE does this very well. It works with all PHP and JavaScript functions; even your own (given you comment them properly)!

Or if you use Sublime Text 2, there's a plugin called SublimeCodeIntel which is a direct port of this feature from Komodo.

1 decade ago by Arantor

Yeah, that's what's being discussed - the problem is that I don't think it's entirely feasible to document them in the source.

The problem is that not every IDE works off the exact same comment hints. Some use that style, some expect @param for example.

1 decade ago by Aranir

Thank you for your answers.

I tried the @param method and it work for the methods i declared in the class itself but all the ones declared it inherits from won't be recognised:
e.g. if I subclass Entity, I declared

/*@param {Entity} myVar/

if I then try to call:
myVar.addA...

He doesn't autocomplete. Is there a way that those methods my class inherits from will show up for autocomplete? how can I reference in the @param the ig.Entity class that it will recognize the methods?

Any ideas would be helpful.

1 decade ago by Joncom

I'm curious what IDE you are using Aranir? It might have something to do with the answer you are given.

1 decade ago by Aranir

I am using PHP Storm from jetbrains, as it was suggested in the book.

I wanted to call the addAnim function from the entity class at that never autocompletes.

What other IDE's are you using (except Komodo), has one of them better autocomplete?
Page 1 of 1
« first « previous next › last »