Skip to main content

Crate bynk_fmt

Crate bynk_fmt 

Source
Expand description

bynk-fmt — the Bynk formatter.

A real leaf crate: the formatter is an AST-walk over the bynk-syntax types, so it depends on bynk-syntax only and never links the compiler (resolver/checker/emitter). Slice 2 of the crate-decomposition track moved the implementation down here from bynkc::fmt and re-pointed it onto the bynk-syntax leaf, turning the former cosmetic façade into the home of the formatter itself. bynkc now depends on this crate and re-exports it as bynkc::fmt for its own bynkc fmt command.

Structs§

FormatError
Error returned when formatting fails. The formatter cannot format code that does not parse, so all failure modes here surface as parse errors.
FormatOptions
Formatter options. All fields have spec-defined defaults.

Enums§

IndentStyle
Indentation style: tabs or spaces. Mirrors the LSP spec’s [fmt].indent setting.

Functions§

format_source
Format a Bynk source string. On parse failure, returns the original source unchanged is not this function’s responsibility — callers (LSP, CLI) decide how to handle parse failure. Here we surface the errors so the caller can do so.