Explorer

definy.resolve-latest-snapshots

description
Find the contents of the parts of the latest main snapshots from index (definy.resolve-snapshot-contents in each snapshot) and continue with the entries of the type checker and the parts that can be referenced, appended to latest and environment
type
Fn(
  commits: List<@definy.latest-snapshot-source>,
  index: Number,
  latest: List<@definy.type-check-entry>,
  environment: List<@core.visibility-target>,
  resolutions: List<List<@definy.resolution-cache-entry>>,
  fresh: List<@definy.snapshot-check-part>,
  then: Fn(
    latest: List<@definy.type-check-entry>,
    environment: List<@core.visibility-target>,
    fresh: List<@definy.snapshot-check-part>
  ) -> @definy.service-io
) -> @definy.service-io
expression
fn(commits$0, index$1, latest$2, environment$3, resolutions$11, fresh$12, then$4) =>
  match @core.list-get(list: $0, index: $1) {
    #none(_) =>
      $4(latest: $2, environment: $3, fresh: $12),
    #some(commit$5) =>
      @definy.resolve-snapshot-contents(
        parts: $5.parts,
        then: fn(parts$6, fresh$13) =>
          @definy.resolve-latest-snapshots(
            commits: $0,
            index: @core.plus(left: $1, right: 1),
            latest: @core.list-concat(
              left: $2,
              right: @core.list-map(
                T: @definy.snapshot-check-part,
                U: @definy.type-check-entry,
                f: fn(item$7) =>
                  match @definy.resolution-for(resolutions: $11, content_hash: $7.content_hash) {
                    #some(hit$14) =>
                      {
                        part_id: $7.id,
                        module_id: $7.module_id,
                        part_type: $14.entry.part_type,
                        type_declaration: $14.entry.type_declaration,
                        expression_key: $14.entry.expression_key,
                        has_expression: $14.entry.has_expression,
                        references: $14.entry.references
                      },
                    #none(_) =>
                      @definy.latest-type-check-entry(part: $7)
                  },
                xs: $6
              )
            ),
            environment: @core.list-concat(
              left: $3,
              right: @core.list-map(
                T: @definy.snapshot-check-part,
                U: @core.visibility-target,
                f: fn(item$8) =>
                  @definy.latest-visibility-target(project_name: $5.project_name, part: $8),
                xs: $6
              )
            ),
            then: fn(latest$9, environment$10, fresh$15) =>
              $4(latest: $9, environment: $10, fresh: $15),
            resolutions: $11,
            fresh: @core.list-concat(left: $12, right: $13)
          ),
        resolutions: $11
      )
  }
visibility
public
definy.resolve-latest-snapshots (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: Uawye1MZaNRFxofEGY5s0WA7oFJQ_-5LF21Qh3CW8xY
content hash: QTyEPRbiB2xwS1LUQPZdnKa5NK_KbWywOi_Gs9LMbiM