All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog
and cargo-dist
's expected
format,
and this project adheres to Semantic
Versioning.
- #785 Added the
coverage
command, that checks how much of the query file is used by the input. - #786 Re-introduce tests to check that all of the language queries are useful.
- #747 Added support for specifying paths to prebuilt grammars in Topiary's configuration
- #780 Measuring scopes are now independent from captures order
- #790 No longer merge config files by default, use priority instead.
- #779 Load relevant grammars before CLI tests
- #705 Added support for Nickel 1.7 extended pattern formatting
- #737 Added the
prefetch
command, that prefetches and caches all grammars in the current configuration - #755 Introduce measuring scopes, which can be used in conjunction with regular scopes to add expressivity to the formatting queries.
- #760 Introduce optional
query_name
predicate, to help with query logging and debugging.
- #720 #722 #723 #724 #735 #738 #739 #745 #755 #759 [#764](#764 Various OCaml improvements
- #762 Various Rust improvements
- #744 #768 Nickel: fix the formatting of annotated multiline let-bindings
- #763 Various Bash fixes and improvements
- #761 No longer use error code 1 for unspecified errors
- #770 Fallback to compile-time included query files when formatting a file
- #704 Refactors our postprocessing code to be more versatile.
- #711 Feature gate all grammars, with supported and contributed languages built by default.
- #716 Dynamicly fetch, compile, and load language grammars. Topiary now no longer ships with statically linked grammars.
- #732 Change how function application and parenthesized expressions are treated in Nickel to reduce the overall noise and indentation
- #736 Updates our Nickel grammar, and adds support for let blocks.
- #769 Move the web playground to a separate branch
- #773 Change the status of Bash from "experimental" to "supported"
- #589 Added syntax highlighting to the playground (excluding Nickel)
- #686 Added support for Nickel pattern formatting
- #697 Setting the log level to INFO now outputs the pattern locations in a (row, column) way.
- #699 Added support for CSS, thanks to @lavigneer
- #703 Switched our configuration over to Nickel
- #626 #627 #628 #626 Various OCaml improvements
- #673 Various TOML fixes
- #678 Ensures the client example project builds, and is tested in CI
- #677 Ensures our playground builds consistently in CI
- #682 Removes prepended linebreaks from equal signs in Nickel annotations
- #692 Improves our installation instructions, thanks to @Jasha10
- #664 Ensures source positions in the logs are consistent thanks to @evertedsphere
- #668 Updates our Nickel grammar
- #672 Completely refactors our crate layout, preparing for a release on crates.io
- #538 Using
cargo-dist
to release Topiary binaries. - #528 #609 Created a
topiary-queries
crate that exports the builtin query files. - #526 Multi-line comments can be indented properly using the new predicate @multi_line_indent_all.
- #533 Topiary can now process multiple files with one call.
- #553 In Nickel, indent when a new infix_expr chain starts.
- #557 Topiary now falls back to the buildin queries when no other query files could be located.
- #573 Added OCamllex support (without injections).
- #576 Added append/prepend versions of scope captures.
- #535 Improved error message when idempotency fails due to invalid output in the first pass.
- #576 Allows prepending/appending
@begin_scope
and@end_scope
- #583 Modernisation of the command line interface (see the CLI Migration Guide, for details)
- #535 Change the error message for an idempotency error to be more descriptive.
- #536 #537 #578 #626 #627 #628 Various OCaml improvements.
- #623 #624 #625 Various Toml improvements thanks @pjjw.
- #533 Bump tree-sitter-ocaml version, which allowed reintroduction of some removed queries.
- #550 Fixed handling of antispace in post-processing.
- #552 Fixed Nickel tag removal.
- #554 #555 Fixed Nickel idempotency issue related to annotations.
- #565 Fixed an issue where Topiary would remove whitespace between predicate parameters in query files.
- #513 Added the
-t, --tolerate-parsing-errors
flags to Topiary,tolerate_parsing_errors
to theFormat
operation of the library, and a "Tolerate parsing errors" checkmark to the playground. These options make Topiary ignore errors in the parsed file, and attempt to format it. - #506 Allows the users to configure Topiary through a user-defined configuration file. More information can be found in the
README.md
.
- #523 Skips rebuilding the tree-sitter
Query
when performing the idempotence check. This improves performance when not skipping the idempotence check by about35%
for OCaml formatting.
- #508 Simplified language detection by treating
ocaml
andocaml_interface
as two distinct languages. This ensures we only have one grammar per language. This removed the-l ocaml_implementation
flag from Topiary and theSupportedLanguage::OcamlImplementation
from the library.
- #522 Reverted the bump to the OCaml grammar and queries. This bump (for as of yet unknown reasons) had a catastrophic impact on Topiary's performance.
- #498 Updated the playground to include a nicer editor.
- #487 Added a flag to
format
function that allows skipping the idempotency check. - #486 Added the processing time to the online playground.
- #484 Enabled the playground to perform on-the-fly formatting.
- #480 Shows which languages are marked as experimental in the playground.
- #494 Bumped the OCaml grammar, and fixed for the renamed
infix_operator
named node. - #490 Bumped the Nickel grammar.
- #493 Fixed #492 by only trimming newlines in prettyprinting.
- #491 Fixed #481, a SIGSEGV in exhaustivity testing.
- Correctly bumped version number in
Cargo.toml
.
- Topiary website, web-based playground and logos.
- Full Nickel formatting support.
- Improved OCaml formatting support.
@append_antispace
and@prepend_antispace
formatting capture names.- WASM build target, for the web-based playground.
- Arbitrary whitespace indentation support.
- Exhaustive query checking in tests.
- Maintain a CHANGELOG and a documented release process.
- Move to a build configuration file, rather than a mixture of hardcoding and parsing query predicates at runtime.
- Conditional predicates, in the query language, to reduce the number of formatting capture names.
- Higher fidelity exit codes.
- Idempotency check in terminal-based playground.
- Reduced verbosity of failed integration test output.
- Various improvements to the test suite.
- Idiomatic improvements to the Rust codebase.
- Restructured repository into a Cargo workspace.
- OCaml idempotency issues.
- Idempotency checking in integration tests.
- Don't process queries that match below leaf nodes.
- Skip over zero-byte matched nodes.
This first public release focuses on the Topiary engine and providing decent OCaml formatting support, with the formatting capture names required to do so.
@allow_blank_line_before
@append_delimiter
/@prepend_delimiter
@append_multiline_delimiter
/@prepend_multiline_delimiter
@append_empty_softline
/@prepend_empty_softline
@append_hardline
/@prepend_hardline
@single_line_no_indent
@append_indent_start
/@prepend_indent_start
@append_indent_end
/@prepend_indent_end
@append_input_softline
/@prepend_input_softline
@append_space
/@prepend_space
@append_spaced_softline
/@prepend_spaced_softline
@delete
@singleline_delete
@do_nothing
@begin_scope
/@end_scope
and scoped softlines
- OCaml (implementations and interfaces)
- JSON
- TOML
- Nickel (experimental)
- Bash (experimental)
- Tree-sitter query language (experimental)
- Rust (experimental)
- Basic formatter authoring tools (terminal-based playground and tree visualisation)
pre-commit-hooks.nix
support
This prototype release was created exclusively to show the validity of the idea of using Tree-sitter to build a formatter. It includes only a prototype JSON formatter.