Bug 357496 - [content assist] No content assist for optional parameters
Summary: [content assist] No content assist for optional parameters
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal with 9 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-13 10:08 EDT by Ingo Rau CLA
Modified: 2013-06-19 11:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ingo Rau CLA 2011-09-13 10:08:09 EDT
Build Identifier: 20110615-0604, JSDT: 1.3.0.v201103031824

The content assist does not work for optional parameters.

Code snippet:
---------
/**
 * @constructor
 * @returns {Class}
 */
function Class()
{
	this.op = function() { };
}

/**
 * Does something.
 * 
 * @param {Class} mandatoryParam mandatory parameter
 */
function f1 (mandatoryParam)
{
	mandatoryParam.op(); // <== Content assist works
}

/**
 * Does something.
 * 
 * @param {Class} [optionalParam] optional parameter
 */
function f2 (optionalParam)
{
	optionalParam.op(); // <== NO CONTENT ASSIST
}
---------

This should work just the same, shouldn't it?
Like this, the [] are no use, as I have to drop them and get back to the good old "(optional)" after the parameter description...

Reproducible: Always
Comment 1 Ingo Rau CLA 2011-09-13 10:59:50 EDT
I just realized one more thing:
Context help (mouse hover over the method op) doesn't work in both cases. However, it works with this code added to the end
----------
var xyz = new Class();
xyz.op(); // <== Content assist works, help works
----------