Block (@NotNull YAMLFormattingContext context, @NotNull ASTNode node) { ASTNode blockScalarNode = node.getTreeParent(); YAMLBlockScalarImpl blockScalarImpl = (YAMLBlockScalarImpl)blockScalarNode.getPsi(); // possible performance problem: parent full indent for every block scalar line int parentFullIndent = getParentFullIndent(context, blockScalarNode.getTreeParent()); Indent indent; TextRange range; Alignment alignment = null; int oldOffset = Math.max(getNodeFullIndent(node) - parentFullIndent, 0); if (blockScalarImpl.hasExplicitIndent()) { range = new TextRange(node.getStartOffset() - oldOffset, node.getTextRange().getEndOffset()); indent = Indent.getSpaceIndent(0, true); } else { // possible performance problem: calculating first line offset for every block scalar line int needOffset = Math.max(oldOffset - getFirstLineOffset(context, blockScalarImpl), 0); range = new TextRange(node.getStartOffset() - needOffset, node.getTextRange().getEndOffset()); alignment = context.computeAlignment(node); indent = Indent.getNormalIndent(true); } return new YAMLBlockScalarItemBlock(range, indent, alignment); }