Documentation
¶
Overview ¶
Package export renders completion results as single-line JSON: the machine-readable test surface and unknown-shell fallback framing of the wire protocol (docs/completion-wire-protocol.md).
The powershell framing shares this emitter with an additional per-candidate "sgr" field; Marshal exposes the corresponding extension point.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format renders candidates and directives in the export framing: a single-line JSON object (no trailing newline) with candidates in engine order, the always-complete directives object, and the usage string. The framing is position-independent: toComplete is accepted for seam symmetry and ignored.
func Marshal ¶
func Marshal(directives wire.Directives, candidates []wire.Candidate, resolve StyleResolver) string
Marshal renders the export schema with an optional per-candidate "sgr" field produced by resolve (powershell's style translation). A nil resolver omits the field entirely, yielding the plain export framing.
Types ¶
type StyleResolver ¶
StyleResolver renders the optional per-candidate "sgr" field: the ECMA-48 SGR parameter numbers translated from the candidate's style tokens. It returns "" when the candidate carries no style (powershell's translation, Phase 5).