use of org.jetbrains.plugins.groovy.lang.psi.impl.GrClosureType in project intellij-community by JetBrains.
the class GroovyParameterInfoHandler method showParameterInfo.
@Override
@SuppressWarnings("unchecked")
public void showParameterInfo(@NotNull GroovyPsiElement place, @NotNull CreateParameterInfoContext context) {
GroovyResolveResult[] variants = ResolveUtil.getCallVariants(place);
final List elementToShow = new ArrayList();
final PsiElement parent = place.getParent();
if (parent instanceof GrMethodCall) {
final GrExpression invoked = ((GrMethodCall) parent).getInvokedExpression();
if (isPropertyOrVariableInvoked(invoked)) {
final PsiType type = invoked.getType();
if (type instanceof GrClosureType) {
addSignatureVariant(elementToShow, (GrClosureType) type);
} else if (type != null) {
addMethodAndClosureVariants(elementToShow, ResolveUtil.getMethodCandidates(type, "call", invoked, PsiUtil.getArgumentTypes(place, true)));
}
} else {
addMethodAndClosureVariants(elementToShow, variants);
}
} else {
elementToShow.addAll(Arrays.asList(variants));
}
filterOutReflectedMethods(elementToShow);
context.setItemsToShow(ArrayUtil.toObjectArray(elementToShow));
context.showHint(place, place.getTextRange().getStartOffset(), this);
}
Aggregations