JSDT Arrays Code Completion [message #1027005] |
Tue, 26 March 2013 12:16 |
Christoph Hausmann Messages: 3 Registered: December 2012 |
Junior Member |
|
|
Hi everyone,
currently I am trying to get code completion working for JavaScript arrays which only contain objects of the same type.
Consider this example:
function Person(name) {
this.name = name;
}
function getPersons() {
var ret = [];
ret[0] = new Person("John");
ret[1] = new Person("Doe");
return ret;
}
Now if I write "getPersons()[0]." I would like to see the property 'name' in the code completion. Instead, I get no completion at all.
I already tried annotating the getPersons() method with JSDoc, e.g.
/**
* @returns {Person[]}
*/
function getPersons() {
var ret = [];
ret[0] = new Person("John");
ret[1] = new Person("Doe");
return ret;
}
or
/**
* @returns {Array<Person>}
*/
function getPersons() {
var ret = [];
ret[0] = new Person("John");
ret[1] = new Person("Doe");
return ret;
}
Unfortunately, this also didn't help. So my question is: how can I get correct code completion for typed arrays?
|
|
|
Powered by
FUDForum. Page generated in 0.03972 seconds