Skip to main content

Module tree

Module tree 

Source
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§

OtherSide
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 its fold_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§

Node
Pairing
Which sides a thing exists on.

Functions§

before_and_after_ids
The before side, and what the after side holds.
docstring_of
The id of the docstring of body, a function body fold on side, as plugin’s queries tag it (<plugin>:docstring, from plugins/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 of plugin’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