Bug 262932

Summary: [assist] Constructor completion makes array allocation difficult
Product: [Eclipse Project] JDT Reporter: Darin Wright <darin.eclipse>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Olivier_Thomann
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Darin Wright CLA 2009-01-29 12:24:58 EST
With the new constructor completion support in code assist, it is difficult to create expressions like:

new Some|thing[]{...<seed the array>...}

(i.e. code assist at the '|')

I can no longer get code assist to just complete the type name - I always have to choose from constructors. Is there a setting I'm missing?
Comment 1 Dani Megert CLA 2009-01-30 09:06:40 EST
Right, in that case we should also see types. Moving to JDT Core.
Comment 2 David Audel CLA 2009-02-04 11:14:18 EST
Created attachment 124690 [details]
Proposed fix

With patch types are also proposed when the expected type in an array.

eg.
X[] x = new Y|

eg.

void foo(X[] x) {
  foo(new Y|

eg.
X[] foo() {
  return new Y|

I can not compute types hierarchies (too costly) so i can not propose only subtypes of X.
Comment 3 David Audel CLA 2009-02-04 11:17:47 EST
Released for 3.5M6

Tests added
  CompletionTests#testConstructor1() -> testConstructor6()
Comment 4 Olivier Thomann CLA 2009-03-10 09:50:57 EDT
Verified for 3.5M6 using I20090310-0100.