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

Bug 351448

Summary: [Content Assist] No parameters populated for constructor for code completion
Product: [WebTools] JSDT Reporter: Ian Tewksbury <itewksbu>
Component: GeneralAssignee: Ian Tewksbury <itewksbu>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: major    
Priority: P3 CC: bunnyyappi, cmjaun, itewksbu, mauromol, thatnitind, yenlu
Version: 3.3Flags: cmjaun: review+
Target Milestone: 3.3.1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix patch
none
JUnit Test Zip
none
Fix Patch - Update 1
none
Fix Patch - Update 2 none

Description Ian Tewksbury CLA 2011-07-07 09:45:01 EDT
Patch for this fix needed some merging so it could be applied to HEAD.

+++ This bug was initially created as a clone of Bug #306958 +++

Build Identifier: Eclipse 3.5.1 - JavaScript Developer Tools 1.1.2.v200908101420-77-FGCCcNBC-BhLcE_Pm - Build id: 20090917225226

Code completion does not populate parameters for constructor.

Animal.prototype=new Object();
function Animal(name){}; // when code completion is invoked, user has no idea the Animal constructor takes any param
Animal.prototype.property="";
Animal.prototype.eat=function(food){};

Reproducible: Always

Steps to Reproduce:
1. Define the above in your JavaScript.
2. Enter "var deer = new Ani" then Ctrl+Space. "Ani" is expanded to "Animal", but there is no bracket and param displayed.
3. Now complete the declaration so that it looks like:
var deer = new Animal('Sam');
4. Now type "deer.e" then Ctrl+Space, see that it's expanded to "deer.eat(food)".

Can code completion for constructors works like a regular function?
Comment 1 Ian Tewksbury CLA 2011-07-07 09:47:55 EDT
Created attachment 199264 [details]
Fix patch

This patch is the same as the patch for Bug 306958 except merged to apply cleanly with HEAD.  Also I have included the fixes in bug 306958.
Comment 2 Ian Tewksbury CLA 2011-07-07 09:49:21 EDT
Created attachment 199265 [details]
JUnit Test Zip

This test project zip needs to go into "org.eclipse.wst.jsdt.ui.tests/testresources/ContentAssist.zip" for the JUnits to work.
Comment 3 Nitin Dahyabhai CLA 2011-07-07 21:40:42 EDT
*** Bug 350976 has been marked as a duplicate of this bug. ***
Comment 4 Chris Jaun CLA 2011-07-13 11:58:51 EDT
Please update this patch based on the corrections we've made in maintenance.
Comment 5 Ian Tewksbury CLA 2011-07-14 09:33:28 EDT
Created attachment 199662 [details]
Fix Patch - Update 1

Updates the patch to merge with current head as well as including the fixes for:
Bug 351997
Bug 351964
Bug 351962
Comment 6 Ian Tewksbury CLA 2011-07-19 09:58:20 EDT
Created attachment 199903 [details]
Fix Patch - Update 2

Updated patch to contain fix for Bug 352374
Comment 7 Chris Jaun CLA 2011-07-19 14:44:20 EDT
Checked into HEAD.