aiken/crates/aiken-project/src
KtorZ 451737237e Fix blueprint generation for recursive types.
This was a bit tricky and I ended up breaking things down a lot and
  trying different path. This commit is the result of the most
  satisfying one.

  It introduces a new 'concept' and types: Definitions and Reference.
  These elements are meant to reflect JSON pointers and JSON-schema
  definitions which we now use for pretty much all user-defined
  data-types.

  In fact, Schemas are no longer inlined, but are always referencing
  some schema under "definitions".

  This indirection is necessary in order to cope with recursive types.
  And while it's only truly necessary for recursive types, using it
  consistently makes it both easier to produce and easier to consume.

  ---

  The blueprint generation for recursive types here also works thanks to
  the 'Definitions' data-structure wrapper around a BTreeMap. This uses
  a strategy where:

  (1) schemas are only generated if they haven't been seen before
  (2) schemas are marked as seen BEFORE actually being generated (to
  effectively stop a recursive generation).

  This relies on one important aspect: the key must be uniquely
  identifying a given schema. Which means that we have to monomorphize
  data-types with generic parameters also here, and use keys that are
  specialized in one data-type.

  ---

  In this large overhaul we've also lost one thing which I didn't bother
  re-introducing yet to keep the work manageable: title for record
  fields. Before, we use to pull those from record constructor when
  available, yet now, every record constructor has been replaced by a
  `$ref`. We could theoritically attach a title to the reference. I'll
  try to quickly add that in a later commit.
2023-03-12 12:44:49 -04:00
..
blueprint Fix blueprint generation for recursive types. 2023-03-12 12:44:49 -04:00
deps fix: toml now have a better way to capture error spans 2023-03-06 13:15:48 -05:00
config.rs fix: toml now have a better way to capture error spans 2023-03-06 13:15:48 -05:00
deps.rs fix: toml now have a better way to capture error spans 2023-03-06 13:15:48 -05:00
docs.rs Fix 'find_modules_prefix' when generating docs. 2023-03-08 12:28:01 +01:00
error.rs feat: introduce EvalResult type 2023-03-08 10:19:36 +01:00
format.rs feat(project): remove Error::List and use Vec<Error> 2023-02-20 15:30:25 -05:00
lib.rs Fix blueprint generation for recursive types. 2023-03-12 12:44:49 -04:00
module.rs feat(lsp): hover and goto definition 2023-02-20 15:30:25 -05:00
options.rs Make tracing configurable, when relevant. 2023-02-16 20:29:41 -05:00
package_name.rs Only use colors & text decorations on ANSI-capable terminals. 2023-02-26 13:19:03 +01:00
paths.rs feat(project): remove Error::List and use Vec<Error> 2023-02-20 15:30:25 -05:00
pretty.rs chore: make folder names match crate name 2022-12-21 18:11:07 -05:00
script.rs feat(aiken-project): use rayon to run tests in parallel 2023-01-09 18:12:18 -05:00
telemetry.rs feat(project): remove Error::List and use Vec<Error> 2023-02-20 15:30:25 -05:00