Expand description
Region trees: each side’s flat preorder list rebuilt as a tree, the records rebuilt from a tree, and the helpers plugins read trees with.
Structs§
- Other
Side - What the other side holds, to tell one side’s paired regions from
one-sided ones. A leaf is paired when the other side holds its
alignment_id: its rows line up with a leaf there. A fold is paired when a region on the other side shares itsfold_state_id: the fold the matcher paired it with, or a region linked to that fold. Only the other side counts, since a link merges fold states within a side as well. - Region
- One region of a side’s tree.
- Source
- One side of the diffed file as a tree.
Enums§
Functions§
- before_
and_ after_ ids - The before side, and what the after side holds.
- docstring_
of - The
idof the docstring ofbody, a function body fold onside, asplugin’s queries tag it (<plugin>:docstring, fromplugins/shared/queries/<language>-docstrings.scm): the body’s first fold child when it starts where the body does (Python), or else the fold just before the body in document order, with only a signature’s worth of lines between them. The search runs back through the body’s siblings and then out through the folds that enclose it, so a fold wrapping the whole function (another plugin’s scope) does not hide the docstring above it; it stops at a fold carrying one ofplugin’s own tags, such as the body of an enclosing function. A plugin that collapses a body links it to its docstring, so the two open and close together. - has_tag
- is_fold
- line_
count - The lines a region spans: for a fold, exactly the lines collapsing it
hides. A body fold spans its body alone, starting the line after the
{or:that opens it. - one_
sided - True when no leaf under
region, itself included, is paired with the other side. - path_to
- Child indices from the root down to the region with this
id. - siblings_
of - The sibling list holding the region with this
id. - sides
- The contract’s sides as the trees the SDK works on. diffr calls this once on the way in, so a plugin is handed the pairing rather than the record.
- sides_
with_ other_ ids - Each side that exists, with what the other side holds.
- walk
- walk_
mut