1
Fork 0
mirror of https://github.com/RGBCube/cstree synced 2025-07-29 18:17:44 +00:00

Set up a module structure (#44)

This commit is contained in:
DQ 2023-04-07 18:06:51 +02:00 committed by GitHub
parent baa0a9f2f0
commit 16f7a3bd80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 2291 additions and 454 deletions

View file

@ -2,7 +2,52 @@
## `v0.12.0`
* Documentation has been improved in most areas, together with a switch to a more principled module structure that allows explicitly documenting submodules.
* The `interning` module has been rewritten. It now provides fuctions for obtaining a default interner (`new_interner` and `new_threaded_interner`) and provides a small, dependency-free interner implementation.
* Compatibility with other interners can be enable via feature flags.
* **Note** that compatibilty with `lasso` is not enabled by default. Use the `lasso_compat` feature to match the previous default.
* Introduced `Language::static_text` to optimize tokens that always appear with the same text (estimated 10-15% faster tree building when used, depending on the ratio of static to dynamic tokens).
* Since `cstree`s are lossless, `GreenNodeBuilder::token` must still be passed the source text even for static tokens.
* Internal performance improvements for up to 10% faster tree building by avoiding unnecessary duplication of elements.
* Use `NonNull` for the internal representation of `SyntaxNode`, meaning it now benefits from niche optimizations (`Option<SyntaxNode>` is now the same size as `SyntaxNode` itself: the size of a pointer).
* Use `NonNull` for the internal representation of `SyntaxNode`, meaning it now benefits from niche optimizations (`Option<SyntaxNode>` is now the same size as `SyntaxNode` itself: the size of a pointer).
* `SyntaxKind` has been renamed to `RawSyntaxKind` to no longer conflict with user-defined `SyntaxKind` enumerations.
* The crate's export module structure has been reorganized to give different groups of definitions their own submodules. A `cstree::prelude` module is available, containing the most commonly needed types that were previously accessible via `use cstree::*`. Otherwise, the module structure is now as follows:
* `cstree`
* `Language`
* `RawSyntaxKind`
* `build`
* `GreenNodeBuilder`
* `NodeCache`
* `Checkpoint`
* `green`
* `GreenNode`
* `GreenToken`
* `GreenNodeChildren`
* `syntax`
* `{Syntax,Resolved}Node`
* `{Syntax,Resolved}Token`
* `{Syntax,Resolved}Element`
* `{Syntax,Resolved}ElementRef`
* `SyntaxNodeChildren`
* `SyntaxElementChildren`
* `SyntaxText`
* `interning`
* `TokenKey` and the `InternKey` trait
* `Interner` and `Resolver` traits
* `new_interner` and `TokenInterner`
* `new_threaded_interner` and `MultiThreadedTokenInterner` (with the `multi_threaded_interning` feature enabled)
* compatibility implementations for interning crates depending on selected feature flags
* `text`
* `TextSize`
* `TextRange`
* `SyntaxText` (re-export)
* `traversal`
* `Direction`
* `WalkEvent`
* `util`
* `NodeOrToken`
* `TokenAtOffset`
* `sync`
* `Arc`
* `prelude`
* re-exports of the most-used items