boolean (PsiDeclarationStatement context) { if (PsiUtil.isLanguageLevel10OrHigher(context)) { return false; } PsiElement[] declaredElements = context.getDeclaredElements(); if (declaredElements.length != 1) { return false; } PsiElement declaredElement = declaredElements[0]; if (!(declaredElement instanceof PsiLocalVariable localVariable)) { return false; } if (!localVariable.hasInitializer()) { return false; } PsiExpression initializer = localVariable.getInitializer(); if (initializer instanceof PsiArrayInitializerExpression || initializer instanceof PsiLambdaExpression) { return false; } if (localVariable.getTypeElement().isInferredType()) { return false; } return isAvailableOnDeclarationCustom(context, localVariable); }