Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wit-component] Extend the WIT printer for use in syntax highlighting (…
…#1956) * [wit-component] add `push_keyword`, `push_doc` * [wit-component] merge printing semicolon and newline * [wit-component] add `newline`, `indent_start`, `indent_end` * [wit-component] simplify `push_str` not accepting `\n` * [wit-component] remove `push_` prefix from `Output` fns * [wit-component] extract the indentation logic * [wit-component] indent only when needed * [wit-component] turn `Output` into a trait * [wit-component] add `type`,`param`,`case` to `Output` * [wit-component] add `version` to `Output` * [wit-component] extract `print_package_outer`, `print_interface_outer` * [wit-component] add `TypeKind` for syntax highlighting * [wit-component] Introduce `WitPrinterExt` Extract the parametrized `Output` from `WitPrinter` in order to remove `Default` from the `Output` trait. `WitPrinter` is kept for backwards compatibility. * Revert "[wit-component] Introduce `WitPrinterExt`" This reverts commit c23ad57. * [wit-component] drop `Default` from `Output`, take `self` in `print` and `print_all` * [wit-component]` rename `Output::type` to `ty` * [wit-component] extract most of `OutputToString` fns to the `Output` trait All methods that do not have to directly manipulate the state have now a default implementation. * [wit-component] make `WitPrinter::print` return `Result<()>` As per PR request, merge `print` with `print_all`.
- Loading branch information