Hinting to analyzer the 'this' context of a function (Javascript)

In Ember.js, it is a standard pattern for Component objects to have a child object keyed on 'actions'. Here is a short code example:


export default Ember.Component.extend({
doTheThing() {
// do stuff
},

actions: {
buttonClicked() {
this.doTheThing();
}
}
});


Note that the `this` keyword inside the `buttonClicked` action is set to the instance parent object. In IntelliJ (and Webstorm I assume, though I use the former), you always see "Unresolved function or method `doTheThing` in the body of the `buttonClicked` action.


My question: In a hypothetical plugin, would it be possible to hint to Intellij that in this case the `this` context is the parent object?


I've never worked on an Intellij plugin before, so I don't even know where to begin looking this up.


---


 EDIT: Bah this appears to be fixed. I upgraded to the 2016 release, and after a re-index, it seems to be working that way by default. 


Just for curiosities sake however, could someone point me to the API docs where one might hint these sorts of framework level things to the code analyzer?


 

Please sign in to leave a comment.