diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java index e1e16e5401e0..9985c07304bf 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaMethodCallElement.java @@ -290,7 +290,10 @@ public class JavaMethodCallElement extends LookupItem implements Type } public static void showParameterHints(LookupElement element, InsertionContext context, PsiMethod method, PsiCallExpression methodCall) { - if (methodCall == null || + if (!CodeInsightSettings.getInstance().SHOW_PARAMETER_NAME_HINTS_ON_COMPLETION || + context.getCompletionChar() == Lookup.COMPLETE_STATEMENT_SELECT_CHAR || + context.getCompletionChar() == Lookup.REPLACE_SELECT_CHAR || + methodCall == null || methodCall.getContainingFile() instanceof PsiCodeFragment || element.getUserData(JavaMethodMergingContributor.MERGED_ELEMENT) != null) { return; @@ -298,10 +301,7 @@ public class JavaMethodCallElement extends LookupItem implements Type PsiParameterList parameterList = method.getParameterList(); int parametersCount = parameterList.getParametersCount(); PsiExpressionList parameterOwner = methodCall.getArgumentList(); - if (parameterOwner == null || !"()".equals(parameterOwner.getText()) || - parametersCount == 0 || - context.getCompletionChar() == Lookup.COMPLETE_STATEMENT_SELECT_CHAR || context.getCompletionChar() == Lookup.REPLACE_SELECT_CHAR || - !CodeInsightSettings.getInstance().SHOW_PARAMETER_NAME_HINTS_ON_COMPLETION) { + if (parameterOwner == null || !"()".equals(parameterOwner.getText()) || parametersCount == 0) { return; }