Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsJSDT Arrays Code Completion
https://www.eclipse.org/forums/index.php/mv/msg/464166/1027005/#msg_1027005
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?]]>Christoph Hausmann2013-03-26T12:16:45-00:00