Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JavaScript Inferrer and TypeBinding
JavaScript Inferrer and TypeBinding [message #1016832] Thu, 07 March 2013 20:27 Go to next message
Dawid Pakula is currently offline Dawid Pakula
Messages: 52
Registered: March 2013
Member
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 10:51 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid Pakula
Messages: 52
Registered: March 2013
Member
Any way?
Maybe plugging into Jsdt compiler and/or Binding resolver


Re: JavaScript Inferrer and TypeBinding [message #1019091 is a reply to message #1016832] Fri, 15 March 2013 02:36 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2310
Registered: July 2009
Senior Member
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).

---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: JavaScript Inferrer and TypeBinding [message #1019448 is a reply to message #1019091] Fri, 15 March 2013 17:59 Go to previous message
Dawid Pakula is currently offline Dawid Pakula
Messages: 52
Registered: March 2013
Member
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: Wed Oct 22 21:45:02 GMT 2014

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

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