Community
Participate
Working Groups
The code assist could be made more intelligent in a number of way. One way is to promote probable expansion in the list, instead of just providing alphabetic sort. This could be made by prioritizing types which would be legal code. Consider the following code fragment: String s = new S<code assist> In this case, I'd like Code Assist to suggest String, not stderr or SampleModel. If I have this class: public class FooExtended extends Foo { Foo myFoo = new Fo<code assist> I'd like Code assist to suggest Foo and all subtypes of Foo beginning with "Fo", topmost in the list.
Philippe has looked into this. It would require to consider the left hand side of the assignment when computing proposals. This is doable, but it is problematic in the case of an expression like: String s= a.getString() In this case you want to get the full set of proposals on the right hand side of the expression. However, your examples below make we wonder whether the code assist engine could handle proposals after new specially. Moving to JDT Core for comment.
No, this wouldn't work either. One could write: Foo myFoo = new FooFactory().getFooInstance(); The sorting is interesting, and I believe it would require an API change so as to give a different answer in the case the left-hand side type is matching the return type of the inserted completion... Need to think about it some more, but what about post 2.0 ?
Deferring.
Reopening
Clearing resolution
Hi David, I think this should be yours (related to code assist).
These features are in M3(20021115) build. // String is the first proposal String s = new S<cursor> // x2 is the first proposal int x1 String x2 String s = x<cursor> // foo2 is the first proposal X foo1(){...} String foo2(){...} void bar(){ String s = foo<cursor> } Closing.