Community
Participate
Working Groups
Created attachment 278621 [details] code-assist-not-work Code Assist does not work under the following conditions: 1. The field is an instance of an anonymous class. 2. Use instance initializer. 3. Use lambda expression. Code Assist does not work below lambda expressions. But above the lambda expression code assist works.
Created attachment 278622 [details] code-assist-work
Most likely, the CompletionParser has issues with this. For investigation please paste your code snippet as text (since we cannot copy-paste from the image :) ).
public class Sample { private Object anonymous = new Object() { { new Thread(() -> { }); // code assist does not work here. } }; }
# The same problem occurs if you use anonymous classes instead of lambda expressions. public class Sample { private Object anonymous = new Object() { { new Thread(new Runnable() { @Override public void run() { } }); // code assist does not work here. } }; } # Code assist works when you separate sentences. public class Sample { private Object anonymous = new Object() { { Runnable r = () -> {}; new Thread(r); // code assist works fine! } }; }
Here's what the CU looks like in CompletionEngine: public class Sample { private Object anonymous; public Sample() { } } It's disappointing to see the whole block of code, which can simply be ignored is causing all sorts of trouble :( But if you invoke the completion ahead of the lambda, it is: public class Sample { private Object anonymous = new Object() { { <CompleteOnName:>; } }; public Sample() { } }
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.
This may still be relevant. Vikas, would you like to take a look?
May this be somewhat related to bug #392981?