Community
Participate
Working Groups
I find that auto-completion with JDT is doing weird stuff with nested classes (both Functional implementations and solid implementations). I am not sure how many are connected, but I'll report them one by one. This one is 100% reproducable with the following MCVE: public class BugTest { public void test() { this.someMethod(O -> { switch(5) { // pos2 case 1: // pos1 break; // pos3 } }); } public void someMethod(Consumer<Object> consumer){ /* no-op */} } In the above case we should be able to use the autocomplete at the marked position [pos1], yet it does not yield any result. I only managed to get the user-templates working. - The enum in the switch-statement can be of any type. - At pos2 and pos3 the autocomplete is working correctly.
(In reply to N247S - from comment #0) > I find that auto-completion with JDT is doing weird stuff with nested > classes (both Functional implementations and solid implementations). I am > not sure how many are connected, but I'll report them one by one. > > This one is 100% reproducable with the following MCVE: > > public class BugTest > { > public void test() > { > this.someMethod(O -> { > switch(5) > { > // pos2 > case 1: > // pos1 > break; > // pos3 > } > }); > } > > public void someMethod(Consumer<Object> consumer){ /* no-op */} > } This snippet does not compile. Please attach a self-contained snippet.
I see you are using 4.9. Please try with https://download.eclipse.org/eclipse/downloads/drops4/S-4.12M1-201904110625/
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. If you have further information on the current state of the bug, please add it. 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.
With this I'm able to reproduce: //--- import java.util.function.Consumer; public class BugTest { public void test(int i) { this.someMethod(O -> { switch(i) { // pos2 case 1: // pos1 break; // pos3 } }); } public void someMethod(Consumer<Object> consumer){ /* no-op */} } //--- (In reply to N247S - from comment #0) > In the above case we should be able to use the autocomplete at the marked > position [pos1], yet it does not yield any result. I only managed to get the > user-templates working. acknowledged. > - At pos2 and pos3 the autocomplete is working correctly. Not for me. If I remove the lambda (so the switch becomes a statement of test(int)), then completions are given: - pos1: various options: good - pos2: only 'case' and 'default': good - pos3: same as pos1, but really? Whatever I chose, it's dead code ...
@Gayan, do you want to take a look at this bug?