GrNamedArgument (@NotNull final String name, @NotNull final GrExpression expression) { PsiFile file = createGroovyFileChecked("foo (" + name + ":" + expression.getText() + ")"); assert file.getChildren()[0] != null; GrCall call = (GrCall)file.getChildren()[0]; return call.getArgumentList().getNamedArguments()[0]; }