I'm trying to create plugin for ExtJS (class declaration, type hierarhy and in the feature semantic analysis I hope).
I've created prototype inferrer (github.com : zulus/extjs-eclipse ) for inferenceProvider extension point (yes its ugly) and partially it works.
But...
I haven't idea how to tell JSDT that Ext.create("className") always will return className object, or set type for TypeField. Where I can find any information about this?
You don't set the type on the invocation itself. When you're walking the AST, you'll use the string value of the classname to make an InferredType, and set that InferredType on the variable declaration or assignment that uses the invocation (and set that inferred type as isDefinition true).
Thank you, now is clear, but I have now new problem with this.
As I see in JSDT function is not an object. (InferredMethod is not a children of InferredType). If I have right, this is the main limitation of JSDT for now.
to create function alias like here:
var item = Ext.Function.alias(MyClass, "funcName");
I have to do two thing:
set inferred type to Function (easy and simple)
find method declaration (if not exists in the same compilation unit it will be hard), and and create method in valid scope. (if this is possible)