use of org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement in project intellij-community by JetBrains.
the class GroovyTypeParameterInfoHandler method findElementForParameterInfo.
@Nullable
@Override
public GrTypeArgumentList findElementForParameterInfo(@NotNull CreateParameterInfoContext context) {
final GrTypeArgumentList parameterList = ParameterInfoUtils.findParentOfType(context.getFile(), context.getOffset(), GrTypeArgumentList.class);
if (parameterList != null) {
if (!(parameterList.getParent() instanceof GrCodeReferenceElement))
return null;
final GrCodeReferenceElement ref = ((GrCodeReferenceElement) parameterList.getParent());
final PsiElement resolved = ref.resolve();
if (!(resolved instanceof PsiTypeParameterListOwner))
return null;
final PsiTypeParameter[] typeParams = ((PsiTypeParameterListOwner) resolved).getTypeParameters();
if (typeParams.length == 0)
return null;
context.setItemsToShow(typeParams);
return parameterList;
}
return null;
}
Aggregations