How to let JSDT know the variable type? [message #648732] |
Fri, 14 January 2011 05:06  |
Eclipse User |
|
|
|
Hi,
I'm working with a tool called Cordys and they have a concept called XForms.
In this Xform I can create a 'Model' and give that a name. Let's call that myModel.
In that XForm I can attach a JS file to do custom scripting. This means that in my .js file I can do something like:
or
What I have done is for all those Model options create a separate js file and add all functions to that JS.
So if I do:
var myModel = new Model();
myModel.re //Code completion works like a charm!
Then it works perfectly and code completion kicks in as it should.
Now my actual problem is that the var myModel = newModel() is NOT present in the JS file.
So what I'm looking for is an easy way to tell the JSDT what type it should assume for the variable.
In Pseudo Code this is what I would like to do:
/**
* @type Model
*/
var myLocalVar = myModel;
I know i.e. Zend does it like this for PHP:
<?php /**
* @param int myInt The integer parameter for the method
*/
function something($myInt)
{
...
} ?>
So the bottom line:
Can I let the code assistant explicitly know which type a variable is?
Thanks in advance!
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03775 seconds