AbstractBlockWrapper (@NotNull AbstractBlockWrapper block) { while (true) { AbstractBlockWrapper parent = block.getParent(); if (parent != null && parent.getEndOffset() == block.getEndOffset()) { block = parent; } else { return block; } } }