DocumentSegment
- class DocumentSegment
-
Members defined in
DocumentSegment(10 members)
RW
RW
RW
Construct
DocumentSegmentfrom the nearest CST node that containsnode.
Construct
DocumentSegmentfrom atree-sitterfield namedfieldatindex. Ifnodedoes not contain a CST node with a matchingfield, the nearest CST segment is returned instead.
Construct
DocumentSegmentfrom atree-sittersymbol namedsymbolatindex. Ifnodedoes not contain a CST node with a matchingsymbol, the nearest CST segment is returned instead. Attributes
- property end: int
- property offset: int
- property range: syside.RangeUtf8
Methods
- __init__(range: syside.RangeUtf8 = ..., offset: int = 0, end: int = 0) None
- static from_cst(arg: syside.CstNode, /) syside.DocumentSegment
- static from_cst_end(arg: syside.CstNode, /) syside.DocumentSegment
- static from_cst_start(arg: syside.CstNode, /) syside.DocumentSegment
- static from_node(arg: syside.AstNode, /) syside.DocumentSegment
Construct
DocumentSegmentfrom the nearest CST node that containsnode.
- static from_node_field(node: syside.AstNode, field: str, index: int = 0) syside.DocumentSegment
Construct
DocumentSegmentfrom atree-sitterfield namedfieldatindex. Ifnodedoes not contain a CST node with a matchingfield, the nearest CST segment is returned instead.
- static from_node_symbol(node: syside.AstNode, symbol: str, index: int = 0) syside.DocumentSegment
Construct
DocumentSegmentfrom atree-sittersymbol namedsymbolatindex. Ifnodedoes not contain a CST node with a matchingsymbol, the nearest CST segment is returned instead.