[reactor] *NonBlockingScopeInspection should check lambdas also

This commit is contained in:
Nicolay Mitropolsky
2018-07-06 10:08:56 +03:00
parent 345acde567
commit f802d0c8c6
2 changed files with 2 additions and 0 deletions
@@ -39,6 +39,7 @@ public final class AnalysisUastUtil {
@Nullable
public static PsiClass getTypePsiClass(@Nullable PsiType type) {
type = GenericsUtil.eliminateWildcards(type);
if (!(type instanceof PsiClassType)) return null;
return ((PsiClassType)type).rawType().resolve();
}
@@ -196,6 +196,7 @@ fun UCallExpression.getParameterForArgument(arg: UExpression): PsiParameter? {
return parameters.withIndex().find { (i, p) ->
val argumentForParameter = getArgumentForParameter(i) ?: return@find false
if (argumentForParameter == arg) return@find true
if (arg is ULambdaExpression && arg.sourcePsi?.parent == argumentForParameter.sourcePsi) return@find true // workaround for KT-25297
if (p.isVarArgs && argumentForParameter is UExpressionList) return@find argumentForParameter.expressions.contains(arg)
return@find false
}?.value