void (Closure<Map<Object, Object>> generator) { PsiElement place = myDescriptor.getPlace(); PsiElement parent = place.getParent(); if (isMethodCall(place, parent)) { assert parent instanceof GrMethodCall && place instanceof GrReferenceExpression; GrReferenceExpression ref = (GrReferenceExpression)place; PsiType[] argTypes = PsiUtil.getArgumentTypes(ref, false); if (argTypes == null) return; String[] types = ContainerUtil.map(argTypes, PsiType::getCanonicalText, new String[argTypes.length]); generator.setDelegate(this); HashMap<String, Object> args = new HashMap<>(); args.put("name", ref.getReferenceName()); args.put("argumentTypes", types); generator.call(args); } }