List<TextRange> (@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) { Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(e.getLanguage()); if (commenter == null) return null; String blockStart = commenter.getBlockCommentPrefix(); String blockEnd = commenter.getBlockCommentSuffix(); if (blockStart == null || blockEnd == null) return null; String elementText = e.getText(); if (elementText == null || !elementText.startsWith(blockStart) || !elementText.endsWith(blockEnd)) return null; TextRange elementRange = e.getTextRange(); return Collections.singletonList(new TextRange(elementRange.getStartOffset() + blockStart.length(), elementRange.getEndOffset() - blockEnd.length())); }