mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
IDEA-161862 Lambda Expressions not showing as implementations of an interface
This commit is contained in:
@@ -101,12 +101,17 @@ public class ReferenceChainLink {
|
||||
PsiPackage pkg = JavaPsiFacade.getInstance(project).findPackage(referenceName);
|
||||
if (pkg != null && pkg.getDirectories(scope).length > 0) return null;
|
||||
|
||||
if (!cache.processFieldsWithName(referenceName, processor, scope, null) ||
|
||||
!cache.processClassesWithName(referenceName, processor, scope, null)) {
|
||||
if (!cache.processFieldsWithName(referenceName, processor, scope, null)) {
|
||||
markExpensive(project);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cache.processClassesWithName(referenceName, processor, scope, null)) {
|
||||
markExpensive(project);
|
||||
return null;
|
||||
}
|
||||
|
||||
return candidates;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
class A {
|
||||
|
||||
void foo() {
|
||||
new IterHelper<>().loopMap((k, val) -> {
|
||||
//do something
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
final class IterHelper<K, V> {
|
||||
public void loopMap(final MapIterCallback<K, V> callback) {
|
||||
//do something
|
||||
}
|
||||
public static interface MapIterCallback<K, V> {
|
||||
abstract void eval(K k, V v);
|
||||
}
|
||||
}
|
||||
@@ -140,6 +140,11 @@ public class FindFunctionalInterfaceTest extends LightCodeInsightFixtureTestCase
|
||||
assertSize(1, FunctionalExpressionSearch.search(findClass("I")).findAll());
|
||||
}
|
||||
|
||||
public void testChainStartingWithConstructor() {
|
||||
configure();
|
||||
assertSize(1, FunctionalExpressionSearch.search(findClass("IterHelper.MapIterCallback")).findAll());
|
||||
}
|
||||
|
||||
public void testDontVisitInapplicableFiles() {
|
||||
PsiClass sam = myFixture.addClass("interface I { void foo(); }");
|
||||
myFixture.addClass("class Some { " +
|
||||
|
||||
Reference in New Issue
Block a user