Community
Participate
Working Groups
build I20090106-1323 1) create missing/MissingType.java package missing; public class MissingType { public MissingType(int i) {} } 2) create test/Test.java package test; public class Test{ void foo() { new MissingType(| // do ctrl+space at | } } 3) do ctrl+space at | There is no proposal The constructor of MissingType should be proposed even missing.MissinType is not imported.
Created attachment 122270 [details] Proposed fix Constructors and anonymous types are proposed with a required proposal. This required proposal is the not imported type.
Released for 3.5M5. Tests added CompletionWithMissingTypesTests#test0041() -> test0046() CompletionWithMissingTypesTests_1_5#test0015()
Added bug 262597 since the constructor's parameters appear in the wrong place once the missing import statement is added. I also do not get any suggestions as a result of invoking code assist. Once the missing import statement is added, I get 2 proposals (call the constructor or create an anonymous type). Its hard to say this is fixed.
Constructors and anonymous types are proposed with a required proposal but currently JDTText does not support anonymous types with a required proposal so the anonymous types are not displayed. I entered a request in JDTText to add this support: bug 262605 (i forgot to entered this request before). As the anonymous case is not supported by jdttext only the simple constructor proposal is currently proposed. This proposal is more visible if you disable the auto insert option (Java>Editor>Content Assist>Insert single proposals automatically). You can also verify this bug by looking the regression tests. In these tests you can see that the constructors and the anonymous types can be proposed.
Disabled auto-completion & the behaviour is better. Verified for 3.5M5 using I20090126-1300