FormatArgument (@NotNull PsiCallExpression call) { PsiExpressionList argList = call.getArgumentList(); if (argList == null || argList.isEmpty()) return null; PsiMethod method = call.resolveMethod(); if (method == null) return null; PsiParameter[] parameters = method.getParameterList().getParameters(); if (parameters.length < 2) return null; PsiType lastParameterType = parameters[parameters.length - 1].getType(); if (lastParameterType instanceof PsiArrayType && TypeUtils.isJavaLangObject(((PsiArrayType)lastParameterType).getComponentType())) { int formatIndex = parameters.length - 2; PsiParameter maybeFormat = parameters[formatIndex]; if (TypeUtils.isJavaLangString(maybeFormat.getType()) && AnnotationUtil.isAnnotated(maybeFormat, "org.intellij.lang.annotations.PrintFormat", AnnotationUtil.CHECK_EXTERNAL)) { PsiExpression[] args = argList.getExpressions(); if (args.length <= formatIndex) return null; return new FormatArgument(formatIndex + 1, args[formatIndex]); } } return null; }