mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
IDEA-155188 Lambda auto completion for incomplete overloaded method fails
This commit is contained in:
@@ -273,6 +273,13 @@ public class JavaCompletionUtil {
|
||||
PsiType qualifierType = LambdaUtil.getLambdaParameterFromType(functionalInterfaceType, parameterIndex);
|
||||
if (qualifierType == null) return;
|
||||
|
||||
if (qualifierType instanceof PsiWildcardType) {
|
||||
PsiType bound = ((PsiWildcardType)qualifierType).getBound();
|
||||
if (bound != null) {
|
||||
qualifierType = bound;
|
||||
}
|
||||
}
|
||||
|
||||
PsiReferenceExpression fakeRef = createReference("xxx.xxx", createContextWithXxxVariable(element, qualifierType));
|
||||
set.addAll(processJavaQualifiedReference(fakeRef.getReferenceNameElement(), fakeRef, elementFilter, options, matcher, parameters));
|
||||
});
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.util.stream.*;
|
||||
import java.util.*;
|
||||
|
||||
class Foo {
|
||||
public static void main(List<String> list) {
|
||||
list.stream().collect(Collectors.toMap(o -> o.sub<caret>))
|
||||
}
|
||||
}
|
||||
@@ -240,6 +240,10 @@ class Test88 {
|
||||
configureByTestName()
|
||||
myFixture.assertPreferredCompletionItems(0, 'toString', 'wait')
|
||||
}
|
||||
public void testLambdaWithSuperWildcardInAmbiguousCall() {
|
||||
configureByTestName()
|
||||
myFixture.assertPreferredCompletionItems(0, 'substring', 'substring', 'subSequence')
|
||||
}
|
||||
public void testUnexpectedLambdaInAmbiguousCall() { doAntiTest() }
|
||||
|
||||
public void testNoCollectorsInComment() { doAntiTest() }
|
||||
|
||||
Reference in New Issue
Block a user