Community
Participate
Working Groups
Created attachment 266187 [details] Code assist failing example Code assist ("Open implementation" / command-click) does not work on methods in a specific situation, see attached example. public class Lambda <T> { Lambda<String> sc = new Lambda<>(); public Lambda<String> get(Lambda<String> sc) { return new Lambda<>(); } public void foo(String s) { sc.get(Lambda.of("")).consume((String ss) -> { System.out.println(""); }, (Throwable failure) -> { System.out.println(""); }); } public static Lambda<String> of(String s) { return new Lambda<>(); } public void consume(Consumer<T> t, Consumer<Throwable> f) { } } In eclipse 4.6.2 "Open implementation" does not work on the "get" and "of" methods in the "foo" method. If I add System.out.println("") first thing in the method it works, if I remove the System.out.println("") in both lambda blocks it also works. Code compiles fine so this is just for the code assist and for a quite specific case.
Noopur, I don't get the offer to "Open implementations", if the syso statements are present. Perhaps the AST UI gets is broken. Can you throw some light on what's going on? Thanks!
org.eclipse.jdt.core.ICodeAssist.codeSelect(int offset, int length) does not return any result in this case. It is invoked in JavaElementHyperlinkDetector.detectHyperlinks(..).
This is still an issue in Oxygen Release (4.7.0) Build id: 20170620-1800 and is starting to get a bit frustrating. Another example likely hitting the same bug: import java.util.concurrent.CompletableFuture; public class OpenDeclarationDoesNotWork { public void foo() { bar().whenComplete((obj, throwable) -> { System.out.println("foobar"); }); } public CompletableFuture<Object> bar() { return null; } } Open declaration does not work for bar() in the foo() method. Any ideas on how to bring this forward and get it fixed?
This seems to be resolved in Photon Release (4.8.0) Build id: 20180619-1200 This has been haunting me for the past one and a half year so good to see it finally becoming resolved, I almost lost hope.