mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
don't start java method call live template if there already are some arguments
This commit is contained in:
@@ -175,11 +175,18 @@ public class JavaMethodCallElement extends LookupItem<PsiMethod> implements Type
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParams && context.getCompletionChar() != Lookup.COMPLETE_STATEMENT_SELECT_CHAR && Registry.is("java.completion.argument.live.template")) {
|
||||
context.commitDocument();
|
||||
if (hasParams && context.getCompletionChar() != Lookup.COMPLETE_STATEMENT_SELECT_CHAR && Registry.is("java.completion.argument.live.template") && isArgumentListEmpty(context)) {
|
||||
startArgumentLiveTemplate(context, method);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isArgumentListEmpty(InsertionContext context) {
|
||||
PsiCallExpression call = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiCallExpression.class, false);
|
||||
PsiExpressionList argList = call == null ? null : call.getArgumentList();
|
||||
return argList != null && argList.getExpressions().length == 0;
|
||||
}
|
||||
|
||||
private void importOrQualify(Document document, PsiFile file, PsiMethod method, int startOffset) {
|
||||
if (willBeImported()) {
|
||||
final PsiReferenceExpression ref = PsiTreeUtil.findElementOfClassAtOffset(file, startOffset, PsiReferenceExpression.class, false);
|
||||
|
||||
Reference in New Issue
Block a user