Community
Participate
Working Groups
In this scenario: public class FooTest { @<|> code assist suggest FooTest as the only completion. This is not correct since FooTest isn't annotation. In particular when you have code assist set to insert single proposals automatically then the current behaviour is frustrating.
I suspect we suggest any type, in case of member annotation types. But, we should only do so when there is any such member type (or by default, we simply do not give anything which isn't truly an annotation type, member annotation types are unlikely to exist).
Indeed we suggest any type, in case of member annotation type. We should propose them only if they have a member type but it is not possible because to known if they have one, we would need to resolve all proposed top level types and it would be too costly to compute. This behavior is similar as exception completion inside 'throws' and 'catch' clauses, is similar as interface completion inside 'extends' clause.. When the completion token is empty (as the test case of this bug report), only enclosing types are proposed. In this specific case we could propose only annotation. In all cases the relevance of annotations is higher than other types.
Right, but Erich's use case (in case of no prefix added) is likely exposing the fact we do not go for an empty search for all type names; and then there is no good more relevant match than the enclosing type. From index search, we could figure member types by checking name info we get back (member types have an enclosing type name). So we could only offer type names which we now are acting as enclosing type names for other ? Also in this specific scenario, all the info is at hand, since we are in the context of the enclosing type we incorrectly suggest.
Not sure if it helps, but as user I rather receive no completions in this scenario insteand of a bogus type name that I have to delete afterwards.
Fixed. Only annotations are proposed. See bug 94965 comment 1.
Verified on build I20050526-2000-win32.