Conversation
typespace becomes a path dependency and takes over the type representation, the query surface, and rendering. typify's own TypeEntry/TypeEntryDetails tree, its query and render facade, and the structural dedup of unnamed types all come out; conversion now builds typespace types directly and to_stream finalizes a TypespaceBuilder and renders through codespace. to_stream and the consumer entry points become fallible so finalization errors (dangling references, name collisions, unsatisfiable trait requirements) surface as Error::Typespace. typespace_ext.rs holds the glue: native type capabilities, patch derives and attributes, and the notes on the gaps that remain relative to typify1's renderer.
with_typify_compat withholds Default from a tuple struct, a unit struct, and a newtype, which typify never derives it for.
Ask for Eq, PartialEq, Ord, PartialOrd, Hash, Display, FromStr, and Copy as desired traits so typespace derives them where it can, and pass the settings-wide extra attributes through with_attr.
Five breaks, all from typespace changes that landed after the last sync: TraitProvision moved to the crate root when it absorbed TraitDisposition, so settings:: no longer names it. Native::new takes the path as &str. Native::name is gone; path() answers a syn::Type. native_name_match reads the last path segment rather than splitting rendered tokens, which is what it wanted anyway: quoting a path spaces out its separators. view::Type::name answers a Cow borrowed from the typespace, so the typespace has to outlive the name in convert's test. parameter_ident_in and parameter_ident_with_lifetime merged into one parameter_ident(scope, lifetime).
test_empty_any_of arrived on main after this branch's previous base and speaks the deleted TypeEntryDetails vocabulary; it now matches on the typespace-backed TypeEntry.
TypeSpaceSettings keeps only what governs conversion (replacements, patches, conversions, crate policy) and carries a typespace::Settings for everything about rendering; map_typespace_settings adjusts it and new() holds typify's defaults. The extra_derives, extra_attrs, struct_builder, and map_type fields and MapType are gone. Derive names from the CLI and the macro go through TraitSpec::parse, so typespace decides whether a name is a trait it models or a foreign derive; a bare foreign name is now an error. A map named by path takes the HashMap preset with that path, since a JSON map key is always string-like.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch to using the
typespacecrate for type construction and code generation.We're going to operate out of the v0_10 branch for a little bit at least, including publishing pre-release versions from that branch.