private static void addPatternToString(@NotNull PsiElement parent,
                                           @NotNull PsiParameter parameter,
                                           @NotNull StringBuilder patternStringBuilder,
                                           @NotNull PatternDefinition patternDefinition,
                                           @NotNull CommentTracker commentTracker) {
      if (parent == parameter) {
        patternStringBuilder.append(patternDefinition.text);
        return;
      }
      for (PsiElement child : parent.getChildren()) {
        if (PsiTreeUtil.isAncestor(child, parameter, false)) {
          addPatternToString(child, parameter, patternStringBuilder, patternDefinition, commentTracker);
        }
        else {
          patternStringBuilder.append(child.getText());
          commentTracker.markUnchanged(child);
        }
      }
    }
private static void addPatternToString(@NotNull PsiElement parent,
                                           @NotNull PsiParameter parameter,
                                           @NotNull StringBuilder patternStringBuilder,
                                           @NotNull PatternDefinition patternDefinition,
                                           @NotNull CommentTracker commentTracker)