GrConstructorInvocation (@NotNull String text, @Nullable PsiElement context) { GroovyFile file = createGroovyFileChecked("class Foo{ def Foo(){" + text + "}}", false, context); return PsiImplUtil.getChainingConstructorInvocation((GrMethod)file.getClasses()[0].getConstructors()[0]); }