Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350928

Summary: [content assist] jsdoc-toolkit array notation is not supported
Product: [WebTools] JSDT Reporter: Dominic Chambers <dominic.chambers>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: azerr
Version: unspecifiedKeywords: plan
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test case for this bug report
none
Tern JSDoc Array none

Description Dominic Chambers CLA 2011-07-01 08:24:53 EDT
Build Identifier: 20110505-1223

The content assist in Eclipse works really well until you hit a method that
returns arrays, at which point there is no way to inform Eclipse which type of
object the array consists of. jsdoc-toolkit uses an array notation to deal with this problem, but Eclipse doesn't recognize this notation.

Reproducible: Always

Steps to Reproduce:
1. Open the attached test case in Eclipse.
2. Try to get Content Assist for oClass.getXs()[0]
3. You will notice that this does not consider oClass.getXs()[0] to be a number, whereas oClass.getXs() is incorrectly considered to be a number.
Comment 1 Dominic Chambers CLA 2011-07-01 08:25:47 EDT
Created attachment 198960 [details]
Test case for this bug report
Comment 2 Angelo ZERR CLA 2015-06-17 03:55:30 EDT
Created attachment 254499 [details]
Tern JSDoc Array

For your information, tern.java provides a support for JSDoc https://github.com/angelozerr/tern.java/wiki/Tern-&-JSDoc-support.

It can manage this feature : 

------------------------------------
 /**
  * @return {Array.<String>}
  */
function f() {
  return null;
}

f()[0]. // here Ctrl+Space shows methods of String like charAt
------------------------------------

You can see result in the attached screenshot.

Note that tern.java will support soon validation with JSDoc https://github.com/angelozerr/tern-lint/wiki/Validation-JSDoc