Community
Participate
Working Groups
I20151201-1100 Content Assist after a single colon ":" for an incomplete method reference shows wrong proposals. Example: class MyException extends RuntimeException { void foo() { Supplier<String> s = String: } void bar(Supplier<String> s) { bar(String:); } void baz(Supplier<String> s) { s = String: } } After the : , I get proposals as if this was the beginning of a new statement. I would expect either no proposals at all, or even better: the same proposals as when I replace "String:" by "String::". If the problem is that's not trivial to distinguish this case from a labeled statement, then a heuristic could be that token sequences "=" <type> ":" or "(" <type> ":" are always the start of a method reference expression and never a labeled statement.
(In reply to Markus Keller from comment #0) I don't know how much of an AST context is available to content assist, but here's a case where the colon is not the delimiter for a labeled statement, but part of a conditional expression: void foo(int a, boolean b){ int aa; int c = b ? aa = a :/*|*/ 0; } Syntactically, this matches the heuristic proposed in comment 0. The 'a' could even be a type reference, and the ':' just the first colon for a method reference! These cases cannot be distinguished if you consider everything after the caret as incomplete (which I think is a basic assumption of content assist). I don't see a good solution any more that would be correct in all cases.
New Gerrit change created: https://git.eclipse.org/r/121607
Hmm, the fix is for Java only and is not suitable to be in jface.text plugin. I Abandoned it in Gerrit
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.