Custom code completion search pattern

Answered

Hi, I am using the IntelliJ IDEA 15 and am looking to define custom patterns that the code completion can use to give me suggestions when I type a certain piece of code.

Currently we are working on a javascript project using a centralised event dispatcher.
When listening to events we use something like:

App.Events.on([eventname], [function], [scope]); //The eventname can be any string.
App.Events.on('case:show', this.show, this);

You trigger an event by calling:

App.Events.trigger([eventname], [params]);
App.Events.trigger('case:show', caseId);

Now I would like IntelliJ to search for all .on() functions and gives back the eventnames as suggestions when I type .trigger( 

Have been searching for this function for quite some time but couldn't find anything to achieve something like this.
Does IntelliJ have such a function and if so whats it called, cause it would surely speed up our coding.

 

Thanks

 

 

1 comment
Comment actions Permalink
Official comment

Hi Mark. Unfortunately, it's not possible now without creating a plugin, but there will be a way to do it in IDEA 16 with the help of JSDoc syntax. Please see WEB-20038 for details.

Please sign in to leave a comment.