@NotNull
  String process(@NotNull MatchResult match, @NotNull ReplacementInfo replacementInfo, @NotNull LanguageFileType type) {
    if (parameterizations.isEmpty()) {
      return replacement;
    }

    final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(type);
    assert profile != null;

    final List<ParameterInfo> sorted = new SmartList<>(parameterizations.values());
    sorted.sort(Comparator.comparingInt(ParameterInfo::getStartIndex).reversed());
    final StringBuilder result = new StringBuilder(replacement);
    for (ParameterInfo info : sorted) {
      final MatchResult r = replacementInfo.getNamedMatchResult(info.getName());
      if (info.isReplacementVariable()) {
        final Object replacement = generateReplacement(info, match);
        if (replacement == null && r != null) {
          profile.handleSubstitution(info, r, result, replacementInfo);
        }
        else {
          Replacer.insertSubstitution(result, 0, info, String.valueOf(replacement));
        }
      }
      else if (r != null) {
        profile.handleSubstitution(info, r, result, replacementInfo);
      }
      else {
        profile.handleNoSubstitution(info, result);
      }
    }

    return result.toString();
  }
@NotNull
  String process(@NotNull MatchResult match, @NotNull ReplacementInfo replacementInfo, @NotNull LanguageFileType type)