How can i select entire TextNode?

Say i have a block node containing only text and hard breaks (code block for example), how can i set selection for entire text inside this block node, having current selection inside it?

Assuming $from is the resolved position at the start of the selection, and $from.parent is a textblock node, TextSelection.create(doc, $from.start(), $from.end()) will give you a text selection covering the text in that textblock.

that works, thank you!