void (PsiElement element, GrIntroduceParameterSettings settings, Project project) { if (!(element.getParent() instanceof GrMethodCallExpression methodCall)) { LOG.error("Unexpected parent type: " + element.getParent()); return; } GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(project); final String name = settings.getName(); LOG.assertTrue(name != null); GrExpression expression = factory.createExpressionFromText(name, null); final GrArgumentList argList = methodCall.getArgumentList(); final PsiElement[] exprs = argList.getAllArguments(); if (exprs.length > 0) { argList.addAfter(expression, exprs[exprs.length - 1]); } else { argList.add(expression); } removeParametersFromCall(methodCall, settings); }