Skip to main content

Module types

Module types 

Source
Expand description

The records of wit/plugin.wit’s types interface. They are generated from the WIT itself by [crate::bindings], so the contract has one definition of each record and nothing to keep in step: a plugin receives and returns exactly these, natively and in a component.

This module adds only what the WIT cannot say: ROOT, the id that names the file rather than a region, and the impls below.

Structs§

Annotation
Deferred presentation content for an existing region. This cannot change topology, alignment, fold identity, or collapsed state.
Cut
FileEntry
One changed file, as its manifest entry describes it. file says which sides the file has and names each; status says how the two relate, which having both sides does not answer: a path that changed is renamed, an object kind that changed type-changed.
FileRef
One side of a git delta, as the manifest names it.
Leaf
Position
0-based line, and 0-based byte column in the UTF-8 text.
QuerySource
A named query source. diffr compiles all enabled sources per language. Names identify sources for imports and diagnostics; shared names must have identical text. Relative imports resolve against this name.
Range
Half-open.
Region
One region of a side’s tree.
Source
One side of a diffed file. regions lists the tree in preorder: a fold comes before its children, and siblings keep their order. A binary file’s sides have empty text and no regions.
Span
Bytes painted as changed on one line.
Visibility
How a region starts out: collapsed or open, and the label shown while it is collapsed (empty for none).

Enums§

FileSides
The sides a changed file has. A deletion is left-only, an addition right-only.
FileStatus
Git’s delta status.
Kind
A leaf tiles the file; a fold’s range is the hull of its children.
Move
What a plugin asks for. A region is named by its id, or the file by 0 where a move allows it. Moves are carried out in order, and the next plugin sees the result; a move that cannot be carried out aborts the run with mutation_failed.
Side
The before (lhs) or after (rhs) side of a comparison.
SourceSides
The sides a diffed file has, the same sides as its entry’s file.

Constants§

ROOT
The id that names the file itself rather than a region.