Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » JavaScript Inferrer and TypeBinding
JavaScript Inferrer and TypeBinding [message #1016832] Thu, 07 March 2013 15:27 Go to next message
Eclipse UserFriend
Hi,

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?

Sorry for my english Wink
Re: JavaScript Inferrer and TypeBinding [message #1018715 is a reply to message #1016832] Thu, 14 March 2013 06:51 Go to previous messageGo to next message
Eclipse UserFriend
Any way?
Maybe plugging into Jsdt compiler and/or Binding resolver
Re: JavaScript Inferrer and TypeBinding [message #1019091 is a reply to message #1016832] Thu, 14 March 2013 22:36 Go to previous messageGo to next message
Eclipse UserFriend
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).
Re: JavaScript Inferrer and TypeBinding [message #1019448 is a reply to message #1019091] Fri, 15 March 2013 13:59 Go to previous message
Eclipse UserFriend
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:

  1. set inferred type to Function (easy and simple)
  2. 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)


In this way:
Ext.define = Ext.Function.alias(MyClass, "define");


  1. Remove inferred attribute define
  2. Find method declaration if it is possible or create a fake
  3. Add new infrred method


In object literals, similar.

Any suggestions?

BTW JSDT not understand this Wink :
var func = function(arg1, arg2) {}
Previous Topic:How to use axis2 commandline options in Eclipse
Next Topic:Apache Derby UI installation exception
Goto Forum:
  


Current Time: Mon Jun 30 17:20:14 EDT 2025

Powered by FUDForum. Page generated in 0.03517 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top