Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » JSDT Arrays Code Completion
JSDT Arrays Code Completion [message #1027005] Tue, 26 March 2013 12:16
Christoph Hausmann is currently offline Christoph HausmannFriend
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: Wed Apr 24 19:26:17 GMT 2024

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

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

Back to the top