private static int collectHighlights(@NotNull final CallArgumentsMapping argumentsMapping,@NotNull final List<PyParameter> parameterList,@NotNull final Map<PyNamedParameter,Integer> parameterToIndex,@NotNull final Map<Integer,EnumSet<ParameterInfoUIContextEx.Flag>> hintFlags,@NotNull final List<PyExpression> flatArgs,int currentParamOffset){
  final PyMarkedCallee callee=argumentsMapping.getMarkedCallee();
  assert callee != null;
  int lastParamIndex=callee.getImplicitOffset();
  for (  PyExpression arg : flatArgs) {
    final boolean mustHighlight=arg.getTextRange().contains(currentParamOffset);
    PsiElement seeker=arg;
    while (!(seeker instanceof PyArgumentList) && seeker instanceof PyExpression && !argumentsMapping.getPlainMappedParams().containsKey(seeker)) {
      seeker=seeker.getParent();
    }
    if (seeker instanceof PyExpression) {
      final PyNamedParameter parameter=argumentsMapping.getPlainMappedParams().get((PyExpression)seeker);
      lastParamIndex=Math.max(lastParamIndex,parameterList.indexOf(parameter));
      if (parameter != null) {
        highlightParameter(parameter,parameterToIndex,hintFlags,mustHighlight);
      }
    }
 else     if (arg == argumentsMapping.getTupleArg()) {
      for (      PyNamedParameter parameter : argumentsMapping.getTupleMappedParams()) {
        lastParamIndex=Math.max(lastParamIndex,parameterList.indexOf(parameter));
        highlightParameter(parameter,parameterToIndex,hintFlags,mustHighlight);
      }
    }
 else     if (arg == argumentsMapping.getKwdArg()) {
      for (      PyNamedParameter parameter : argumentsMapping.getKwdMappedParams()) {
        lastParamIndex=Math.max(lastParamIndex,parameterList.indexOf(parameter));
        highlightParameter(parameter,parameterToIndex,hintFlags,mustHighlight);
      }
    }
 else {
      final List<PyNamedParameter> namedParameters=argumentsMapping.getNestedMappedParams().get(arg);
      if (namedParameters != null) {
        for (        PyNamedParameter parameter : namedParameters) {
          lastParamIndex=Math.max(lastParamIndex,parameterList.indexOf(parameter));
          highlightParameter(parameter,parameterToIndex,hintFlags,mustHighlight);
        }
      }
    }
  }
  return lastParamIndex;
}

private static int collectHighlights ( @ NotNull final CallArgumentsMapping argumentsMapping , @ NotNull final List < PyParameter > parameterList , @ NotNull final Map < PyNamedParameter , Integer > parameterToIndex , @ NotNull final Map < Integer , EnumSet < ParameterInfoUIContextEx . Flag > > hintFlags , @ NotNull final List < PyExpression > flatArgs , int currentParamOffset ) { final PyMarkedCallee callee = argumentsMapping . getMarkedCallee ( ) ; assert callee != null ; int lastParamIndex = callee . getImplicitOffset ( ) ; for ( PyExpression arg : flatArgs ) { final boolean mustHighlight = arg . getTextRange ( ) . contains ( currentParamOffset ) ; PsiElement seeker = arg ; while ( ! ( seeker instanceof PyArgumentList ) && seeker instanceof PyExpression && ! argumentsMapping . getPlainMappedParams ( ) . containsKey ( seeker ) ) { seeker = seeker . getParent ( ) ; } if ( seeker instanceof PyExpression ) { final PyNamedParameter parameter = argumentsMapping . getPlainMappedParams ( ) . get ( ( PyExpression ) seeker ) ; lastParamIndex = Math . max ( lastParamIndex , parameterList . indexOf ( parameter ) ) ; if ( parameter != null ) { highlightParameter ( parameter , parameterToIndex , hintFlags , mustHighlight ) ; } } else if ( arg == argumentsMapping . getTupleArg ( ) ) { for ( PyNamedParameter parameter : argumentsMapping . getTupleMappedParams ( ) ) { lastParamIndex = Math . max ( lastParamIndex , parameterList . indexOf ( parameter ) ) ; highlightParameter ( parameter , parameterToIndex , hintFlags , mustHighlight ) ; } } else if ( arg == argumentsMapping . getKwdArg ( ) ) { for ( PyNamedParameter parameter : argumentsMapping . getKwdMappedParams ( ) ) { lastParamIndex = Math . max ( lastParamIndex , parameterList . indexOf ( parameter ) ) ; highlightParameter ( parameter , parameterToIndex , hintFlags , mustHighlight ) ; } } else { final List < PyNamedParameter > namedParameters = argumentsMapping . getNestedMappedParams ( ) . get ( arg ) ; if ( namedParameters != null ) { for ( PyNamedParameter parameter : namedParameters ) { lastParamIndex = Math . max ( lastParamIndex , parameterList . indexOf ( parameter ) ) ; highlightParameter ( parameter , parameterToIndex , hintFlags , mustHighlight ) ; } } } } return lastParamIndex ; }
match params to available args , highlight current param ( s )
