Skip to main content

Crate lex_config

Crate lex_config 

Source
Expand description

Shared configuration for the Lex toolchain.

Defines LexConfig — the config struct consumed by all Lex applications. Defaults are compiled into the struct via #[clapfig(default)]. Loading and layering is handled by clapfig in the CLI.

Structs§

ConvertConfig
Format-specific conversion knobs.
DiagnosticsConfig
Diagnostics options.
DiagnosticsRulesConfig
Per-rule severity for diagnostics.
FormattingConfig
Formatting-related configuration groups.
FormattingRulesConfig
Mirrors the knobs exposed by the Lex formatter.
HtmlConfig
IncludesConfig
Include-resolution options consumed by lexd convert, lexd inspect, and the LSP. lexd format never expands includes regardless.
InspectAstConfig
InspectConfig
Controls AST-related inspect output.
LabelsConfig
[labels] block in .lex.toml — declarations of extension namespaces the workspace owner wants the host to load.
LexConfig
Top-level configuration consumed by Lex applications.
LoadedLexConfig
Typed configuration plus the side-channel map of extension-emitted diagnostic rules. Returned by [apply_extension_rules_callback]-aware loaders.
NamespaceTable
NodemapConfig
PdfConfig
SchemaRulesConfig
Schema-validation diagnostics. Each field maps to one of the schema pre-validation checks the analyser performs before dispatching to an extension handler. See the Extending Lex proposal (comms/specs/proposals/extending-lex.lex) §13.2.

Enums§

LabelsConfigError
Errors emitted by load_labels_from_toml and NamespaceSpec::canonical_uri.
NamespaceSpec
One namespace declaration. Three on-disk shapes parse into the same logical record:
PdfPageSize
RuleConfig
One entry in a [diagnostics.rules] block.
Severity
User-facing severity for a diagnostic rule.
Via
Transport selector for URL-template namespace declarations (github:, gitlab:). The default, when unset, is Https — the public tarball/archive path — to match the original (pre-via) behaviour.

Constants§

CONFIG_FILE_NAME
Canonical config file name used by the CLI and LSP.
DIAGNOSTICS_RULES_PATH
Dotted-path prefix under which extension-emitted diagnostic codes live (<namespace>.<code> style keys, e.g. "acme.task-due-date-missing" = "warn"). Used with clapfig’s accept_dotted_extension_keys_in helper: any unknown key in this subtree whose remainder contains a . is treated as an extension code and routed to the collected- unknowns list; bare typos at this level or typos inside [diagnostics.rules.schema] still fail strict-mode validation.

Functions§

collect_extension_diagnostic_rules
Drain clapfig’s CollectedUnknown list into a BTreeMap<String, RuleConfig> suitable for LoadedLexConfig::extension_diagnostic_rules.
load_labels_from_toml
Load the [labels] block from a .lex.toml at path. Returns an empty config if the file exists but has no [labels] block; Io::NotFound is propagated to the caller (the CLI usually treats it as “no labels configured” and continues).

Type Aliases§

RuleOptions
Free-form options table forwarded to a rule’s emission code.