Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351448 - [Content Assist] No parameters populated for constructor for code completion
Summary: [Content Assist] No parameters populated for constructor for code completion
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 3.3.1   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
: 350976 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-07 09:45 EDT by Ian Tewksbury CLA
Modified: 2011-07-19 14:44 EDT (History)
6 users (show)

See Also:
cmjaun: review+


Attachments
Fix patch (298.22 KB, patch)
2011-07-07 09:47 EDT, Ian Tewksbury CLA
no flags Details | Diff
JUnit Test Zip (3.72 KB, application/zip)
2011-07-07 09:49 EDT, Ian Tewksbury CLA
no flags Details
Fix Patch - Update 1 (287.96 KB, patch)
2011-07-14 09:33 EDT, Ian Tewksbury CLA
no flags Details | Diff
Fix Patch - Update 2 (288.04 KB, patch)
2011-07-19 09:58 EDT, Ian Tewksbury CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.