void (@NotNull PsiReference reference, @NotNull List<? super UsageInfo> usages, @NotNull PsiNamedElement parameter, int paramIdx, boolean isVararg) { final PsiElement element = reference.getElement(); GrCall call = null; if (element instanceof GrCall) { call = (GrCall)element; } else if (element.getParent() instanceof GrCall) { call = (GrCall)element.getParent(); } if (call != null) { GrSignature signature = GrClosureSignatureUtil.createSignature(call); if (signature == null) return;//todo ??? GrClosureSignatureUtil.ArgInfo<PsiElement>[] argInfos = GrClosureSignatureUtil.mapParametersToArguments(signature, call); if (argInfos == null) return; //todo??? for (PsiElement arg : argInfos[paramIdx].args) { usages.add(new SafeDeleteReferenceJavaDeleteUsageInfo(arg, parameter, true)); } } else if (element instanceof GrDocMethodReference) { @NonNls final StringBuilder newText = new StringBuilder(); newText.append("/** @see "); GrDocReferenceElement holder = ((GrDocMethodReference)element).getReferenceHolder(); if (holder != null) { newText.append(holder.getText()); } newText.append('#'); newText.append(((GrDocMethodReference)element).getReferenceName()); newText.append('('); final List<GrDocMethodParameter> parameters = new ArrayList<>(Arrays.asList(((GrDocMethodReference)element).getParameterList().getParameters())); parameters.remove(paramIdx); newText.append(StringUtil.join(parameters, p -> p.getText(), ",")); newText.append(")*/"); usages.add(new SafeDeleteReferenceJavaDeleteUsageInfo(element, parameter, true) { @Override public void deleteElement() throws IncorrectOperationException { PsiElement e = getElement(); if (e != null) { ((GrDocMethodReference)e).bindToText(e.getProject(), newText.toString()); } } }); } }