export

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 2 Imported by: 0

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

func Format(toComplete string, directives wire.Directives, candidates []wire.Candidate) string

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

type StyleResolver func(candidate wire.Candidate) string

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL