use of com.perl5.lang.perl.psi.mixins.PerlMethodMixin in project Perl5-IDEA by Camelcade.
the class PerlParameterInfoHandler method getMethodCallArguments.
@Nullable
private static PerlParameterInfo[] getMethodCallArguments(@NotNull PsiPerlCallArgumentsImpl arguments) {
PsiElement run = arguments.getPrevSibling();
while (run != null) {
if (run instanceof PerlMethodMixin) {
PerlSubNameElement subNameElement = ((PerlMethodMixin) run).getSubNameElement();
if (subNameElement == null) {
break;
}
PerlParameterInfo[] parameterInfos;
for (PsiReference reference : subNameElement.getReferences()) {
if (reference instanceof PsiPolyVariantReference) {
for (ResolveResult resolveResult : ((PsiPolyVariantReference) reference).multiResolve(false)) {
parameterInfos = getTargetParameterInfo(resolveResult.getElement());
if (parameterInfos != null) {
return parameterInfos;
}
}
} else {
parameterInfos = getTargetParameterInfo(reference.resolve());
if (parameterInfos != null) {
return parameterInfos;
}
}
}
}
run = run.getPrevSibling();
}
return null;
}
Aggregations