TextRange (@NotNull TextRange originalRange) { TextRange validRange = ensureRangeIsValid(originalRange); ASTNode containingNode = CodeFormatterFacade.findContainingNode(myFile, expandToLine(validRange)); if (containingNode != null && !validRange.isEmpty()) { return narrowToMaxExtensionLines(validRange, getRangeWithSiblings(containingNode)); } return validRange; }