boolean (@NotNull PsiComment comment) { final TextRange range = comment.getTextRange(); final TextRange expandedRange = myDocument == null ? range : ArrangementUtil.expandToLineIfPossible(range, myDocument); final String commentText = comment.getText().trim(); final ArrangementSectionRule openSectionRule = isSectionStartComment(mySettings, commentText); if (openSectionRule != null) { mySectionEntryProducer.consume(new ArrangementSectionEntryTemplate(comment, START_SECTION, expandedRange, commentText)); myOpenedSections.push(openSectionRule); return true; } if (!myOpenedSections.isEmpty()) { final ArrangementSectionRule lastSection = myOpenedSections.peek(); if (lastSection.getEndComment() != null && StringUtil.equals(commentText, lastSection.getEndComment())) { mySectionEntryProducer.consume(new ArrangementSectionEntryTemplate(comment, END_SECTION, expandedRange, commentText)); myOpenedSections.pop(); return true; } } return false; }