Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (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 PakulaFriend
Messages: 290
Registered: March 2013
Senior 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 PakulaFriend
Messages: 290
Registered: March 2013
Senior 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 DahyabhaiFriend
Messages: 4435
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 Web Tools Platform
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 PakulaFriend
Messages: 290
Registered: March 2013
Senior 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: Thu Apr 25 21:37:12 GMT 2024

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

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

Back to the top