Community
Participate
Working Groups
Using build I200410190941. Test case: "IXX.java", "/**\n" + " * @see IYY\n" + " */\n" + "public interface IXX {}", "IYY.java", "public interface IYY {}" In IXX.java, set cursor just after @see IYY and launch completion. Then, you get 2 proposals in the list: IXX.java IYY.java This is not correct, first proposal (current type) should not be proposed!
The problem seems to be inside JavaDocCompletionEvaluator#evalTypeNameCompletions(). 'currElem' is added at the end of the proposals list but this method does not verify if the prefix match. Move to JDT/Text
Martin, why do we do this?
We use the code assist proposals give in type body (outside a comment). Question to David, why is code assist's only proposal the outer type?
To perform codeassist inside javadoc, a fake import statement is added. And codeassist does not propose types of the current compilation unit inside import statement (it is not useful).
Oops, You're right, for '@see' in top level type comments it's a fake import statement, there it's my bug (fixed > 20041027) It's inside the type where the similar problem appears: In the following example I get 'Test' suggested, as the only type. Why? package test; class Test { |code assist here }
When the completion token is empty, only enclosing types are proposed to avoid to propose all the types of the workspace (rt.jar + all projects contents). Propose too many types would not be useful (rt.jar is very big) because only the top of the list would be seen and it would be expensive to compute. If the completion token have at least one character more types are proposed.
I understand the problem with too many types and requiring a least one character as prefix. But why then still showing the enclosing types on the empty prefix? I think that's more irritating than helping.
When the token is empty the exact behavior is to propose enclosing types and expected types. class X { Y y = (|code assist here } In this exemple only X and Y are proposed. We do not want to propose too many types, but propose nothing would mean that you cannot insert a type here. So enclosing types and expected types seems to be the less wrong subset of possible types.
marking the PR as fixed (see comment 5)