github typstyle-rs/typstyle v0.15.2

one hour ago

Rust crates (typstyle and typstyle-core) and native CLI binaries are available for v0.15.2. The WASM build failed, so @typstyle/typstyle-wasm-bundler v0.15.2 was not published to npm. WASM consumers should continue using their previous package version.

Release workflow details

  • Feature(CLI): Add --line-ending=lf|crlf|preserve with preserve as the default.
    Preservation generates CRLF only when the input contains at least one CRLF
    and has no bare LF or bare CR; otherwise it generates LF. lf and crlf force
    generated breaks. The default
    --check now accepts formatted CRLF files; use --line-ending=lf to enforce LF.
    (#496)
  • Feature(Core): Add Config::line_ending and with_line_ending for LF, CRLF,
    or default conservative preservation in document and partial formatting. Detection
    uses the whole original document, including for range edits. Literal text remains
    verbatim. The CLI uses the pretty renderer directly without output conversion.
  • Feature: Add wrap_mode = "fill-sentence" / --wrap-text=fill-sentence, a middle ground
    between fill and sentence: like sentence, each sentence starts on a new line; like
    fill, each sentence's words are reflowed to the line width instead of leaving it as one
    unbounded line or preserving manual line breaks.
  • Fix: Preserve trailing spaces and whitespace-only lines inside multiline strings, raw blocks, and format-disabled source instead of trimming every rendered line.
  • Fix: Avoid generated indentation on blank lines and unnecessary flow spaces at line boundaries, including in partial formatting and aligned math. Line comments and block comments with leading stars still have trailing whitespace trimmed during comment formatting.
  • Fix: Range formatting now matches document formatting when the range covers the whole source. Previously the returned edit could be narrower than the requested range and its content could miss document layout such as the final newline.
  • Fix: Range formatting now honors @typstyle off directives attached to syntax outside the selected range, including when the document has unrelated syntax errors.
  • Fix: Range formatting no longer deletes code separators when the selection is whitespace-only, such as an empty cursor position or a line break between statements.
  • Fix: Range formatting of markup selections no longer adds document-level layout (such as a trailing newline) or layout inferred from source outside the replaced range.
  • Fix: Range formatting of code keeps comments and semicolons at the replacement boundary, so the applied edit cannot merge the formatted fragment with the following statement.

Don't miss a new typstyle release

NewReleases is sending notifications on new releases.