mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not complete after return based on info from containing method (IDEA-90729)
This commit is contained in:
@@ -371,6 +371,13 @@ public class JavaCompletionData extends JavaAwareCompletionData {
|
||||
|
||||
return TailType.HUMBLE_SPACE_BEFORE_WORD;
|
||||
}
|
||||
if (scope instanceof PsiLambdaExpression) {
|
||||
final PsiType returnType = LambdaUtil.getFunctionalInterfaceReturnType(((PsiLambdaExpression)scope));
|
||||
if (PsiType.VOID.equals(returnType)) {
|
||||
return TailType.SEMICOLON;
|
||||
}
|
||||
return TailType.HUMBLE_SPACE_BEFORE_WORD;
|
||||
}
|
||||
scope = scope.getParent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,11 @@ import java.util.*;
|
||||
public class LambdaUtil {
|
||||
private static final Logger LOG = Logger.getInstance("#" + LambdaUtil.class.getName());
|
||||
|
||||
@Nullable
|
||||
public static PsiType getFunctionalInterfaceReturnType(PsiLambdaExpression expr) {
|
||||
return getFunctionalInterfaceReturnType(expr.getFunctionalInterfaceType());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static PsiType getFunctionalInterfaceReturnType(PsiType functionalInterfaceType) {
|
||||
final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(functionalInterfaceType);
|
||||
|
||||
Reference in New Issue
Block a user