private Block createBlock(ASTNode injectionHost, Wrap wrap, Alignment alignment, Indent indent, TextRange range) {
    if (range.getStartOffset() == 0) {
      final ASTNode leaf = injectionHost.findLeafElementAt(range.getEndOffset() - 1);
      return createBlockBeforeInjection(
        leaf, wrap, alignment, indent, range.shiftRight(injectionHost.getStartOffset()));
    }
    final ASTNode leaf = injectionHost.findLeafElementAt(range.getStartOffset());
    return createBlockAfterInjection(
      leaf, wrap, alignment, indent, range.shiftRight(injectionHost.getStartOffset()));
  }
private Block createBlock(ASTNode injectionHost, Wrap wrap, Alignment alignment, Indent indent, TextRange range)