Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JSDT Arrays Code Completion
JSDT Arrays Code Completion [message #1027005] Tue, 26 March 2013 08:16
Christoph Hausmann is currently offline 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?
Previous Topic:HTML in text markers
Next Topic:JavaScript JSDock provider
Goto Forum:
  


Current Time: Tue Sep 02 03:00:44 EDT 2014

Powered by FUDForum. Page generated in 0.10169 seconds