syside.DocumentSegment

class DocumentSegment(range: syside.RangeUtf8 = ..., offset: int = 0, end: int = 0)

Initialization

property range: syside.RangeUtf8
property offset: int
property end: int
static from_cst(arg: syside.CstNode, /) syside.DocumentSegment
static from_cst_start(arg: syside.CstNode, /) syside.DocumentSegment
static from_cst_end(arg: syside.CstNode, /) syside.DocumentSegment
static from_node(arg: syside.AstNode, /) syside.DocumentSegment

Construct DocumentSegment from the nearest CST node that contains node.

static from_node_field(node: syside.AstNode, field: str, index: int = 0) syside.DocumentSegment

Construct DocumentSegment from a tree-sitter field named field at index. If node does not contain a CST node with a matching field, the nearest CST segment is returned instead.

static from_node_symbol(node: syside.AstNode, symbol: str, index: int = 0) syside.DocumentSegment

Construct DocumentSegment from a tree-sitter symbol named symbol at index. If node does not contain a CST node with a matching symbol, the nearest CST segment is returned instead.

__eq__(arg: object, /) bool
__ne__(arg: object, /) bool
__cpp_name__: str = 'syside::DocumentSegment'