private void doSurround(@NotNull ActionContext context, @NotNull List<@NotNull PsiElement> elements, @NotNull ModPsiUpdater updater) {
      if (elements.isEmpty()) return;
      PsiElement firstElement = elements.get(0);
      PsiElement lastElement = elements.get(elements.size() - 1);
      PsiFile psiFile = firstElement.getContainingFile();
      String linePrefix;
      String lineSuffix;
      Language language = psiFile.getLanguage();
      if (myProvider.wrapStartEndMarkerTextInLanguageSpecificComment()) {
        Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(language);
        if (commenter == null) return;
        linePrefix = commenter.getLineCommentPrefix();
        lineSuffix = "";
        if (linePrefix == null) {
          linePrefix = commenter.getBlockCommentPrefix();
          lineSuffix = StringUtil.notNullize(commenter.getBlockCommentSuffix());
        }
        if (linePrefix == null) return;
      }
      else {
        linePrefix = "";
        lineSuffix = "";
      }
      int prefixLength = linePrefix.length();

      int startOffset = firstElement.getTextRange().getStartOffset();
      final Document document = firstElement.getContainingFile().getFileDocument();
      final int startLineNumber = document.getLineNumber(startOffset);
      final String startIndent = document.getText(new TextRange(document.getLineStartOffset(startLineNumber), startOffset));
      int endOffset = lastElement.getTextRange().getEndOffset();
      int delta = 0;
      TextRange rangeToSelect = TextRange.create(startOffset, startOffset);
      String startText = myProvider.getStartString();
      int descPos = startText.indexOf("?");
      if (descPos >= 0) {
        startText = startText.replace("?", DEFAULT_DESC_TEXT);
        rangeToSelect = TextRange.from(startOffset + descPos, DEFAULT_DESC_TEXT.length());
      }

      String startString = linePrefix + startText + lineSuffix + "\n" + startIndent;
      String endString = "\n" + startIndent + linePrefix + myProvider.getEndString() + lineSuffix;
      document.insertString(endOffset, endString);
      delta += endString.length();
      document.insertString(startOffset, startString);
      delta += startString.length();
      
      RangeMarker rangeMarkerToSelect = document.createRangeMarker(rangeToSelect.shiftRight(prefixLength));
      Project project = context.project();
      PsiDocumentManager.getInstance(project).commitDocument(document);
      adjustLineIndent(project, psiFile, language, TextRange.from(endOffset + delta - endString.length(), endString.length()));
      adjustLineIndent(project, psiFile, language, TextRange.from(startOffset, startString.length()));
      rangeToSelect = TextRange.create(rangeMarkerToSelect.getStartOffset(), rangeMarkerToSelect.getEndOffset());
      rangeMarkerToSelect.dispose();
      updater.select(rangeToSelect);
    }
private void doSurround(@NotNull ActionContext context, @NotNull List<@NotNull PsiElement> elements, @NotNull ModPsiUpdater updater)