Community
Participate
Working Groups
Define a class as follows: public class A { public static class B {} } Class B shows up in the "Open Type" list. However, it does not show up for the code-assist list.
In which context do you activate the code assist ? Is there anything in the log file ? Moving to JDT/Core.
I think that you must type "A." and then invoke code assist and you will see B as a choice. So what does java language really conside the name of a nested top-level class to be? I think the prefix makes sense because it reduces the number of hits, and you can get help with the prefix. Maybe it would be interesting if the wildcards available in "open type" also worked in code assist. So I could type Multi*Editor<<CODEASSSIST>> or A*.Liste<<CODEASSIST>>.
I was invoking code-assist from some other class that wanted to use class B but not class A. The problem with doing A.<<code-assist>> is that you will have to import A and then refer to B as A.B everywhere, when what one would want is for A.B to be imported. It might be alright to resolve public static innner-classes for code-assist.
If i understand correctly then your test case is the following A.java : package p; public class A { public static class B { } } X.java : package q; public class X { B //<-- do code assist here } The number of proposals is 532 without member classes and 642 with member classes. Most of the time these additionnal proposals won't be useful and risk to hide useful results. This number of result can be decrease by propose only static member. But i think it is not a good idea. We could add the new proposals at the end of list with low relevance index. Another solution could be to use import statment to compute member type proposals. X.java : package q; import p.A.*; public class X { B // do code assist here } -------------------------- I change the severity of the bug to 'enhancement' because the current behavior works as expected.
Let's say the classes names are "Bbbb" and "Aaaa". If you type Aaaa.B<<CODEASSIST>>, no proposals are presented. If you import Aaaa, then you see proposals, but there is no way to get code assist to import "p.Aaaa.Bbbb". Adding imports is one of the main features of code assist. What are the coding conventions on this type of import? It is valid, but is such usage recommended? I've never seen it used. I agree that the current behavior when typeing Bb<<CODEASSIST>> is not bad, but your data would be more interesting if you showed only static nested classes.
In my comment 4 'works as expected' means that only top level types are proposed.
+ 1 for having code assist showing the member types. This a long wanted request of mine. As soon as I type the 2nd and 3rd letter the list will get shorter. Most important is that I can find the type in the list. Note that quick fix also depends on the code assist infrastructure. We currently can't offer import fixes or rename corrections code like Inner inner= new Inner();
*** This bug has been marked as a duplicate of 94965 ***