Skip to content

Added array composition resolvers.#29

Merged
lextatic merged 5 commits into
mainfrom
feature/array-resolver
May 19, 2026
Merged

Added array composition resolvers.#29
lextatic merged 5 commits into
mainfrom
feature/array-resolver

Conversation

@lextatic

Copy link
Copy Markdown
Contributor

Added

  • Added ArrayResolver and EntityArrayResolver.

Fixed

  • Fixed documentation for ArrayVariableResolver and EntityArrayVariableResolver.

@lextatic lextatic added the added New features label May 18, 2026
@lextatic lextatic requested a review from Copilot May 18, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new composition resolvers, ArrayResolver and EntityArrayResolver (built on a shared generic ReferenceArrayCompositeResolver<T>), which build arrays by evaluating nested resolvers per element rather than reading from a variable. Also tightens documentation: the existing array-resolver.md (which actually described the variable resolver) is split into array-resolver.md (new composite) and array-variable-resolver.md, with cross-links and the resolvers README updated. IEntityResolver is simplified to an empty interface declaration using C# 12 syntax.

Changes:

  • Introduces ArrayResolver, ReferenceArrayCompositeResolver<T>, and EntityArrayResolver, with type-inference and explicit-type constructors plus per-element validation.
  • Adds focused unit tests for both composite resolvers and a helper ResolveReferenceArrayResolverNode<T> test node.
  • Restructures the array-resolver docs (new file for variable resolver, rewritten composite-resolver doc), updates the resolvers README, custom-resolvers guide, and entity-array see-also links.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Forge/Statescript/Properties/ArrayResolver.cs New value-array composite resolver with inferred or explicit element type and full validation.
Forge/Statescript/Properties/ReferenceArrayCompositeResolver.cs Generic base composite resolver for reference arrays; validates non-null nested resolvers.
Forge/Statescript/Properties/EntityArrayResolver.cs Convenience subclass of the composite resolver for IForgeEntity references.
Forge/Statescript/Properties/IEntityResolver.cs Converts empty interface body to C# 12 declaration form.
Forge.Tests/Statescript/Resolvers/ArrayCompositionResolverTests.cs Tests covering ordering, type inference, empty-typed arrays, mismatched types, and graph integration.
Forge.Tests/Statescript/Resolvers/EntityArrayResolverTests.cs Tests covering nested entity resolution, missing activation context, and reference-array property type validation.
Forge.Tests/Helpers/StatescriptTestHelpers.cs Adds ResolveReferenceArrayResolverNode<T> helper node for executing reference-array resolvers in test graphs.
docs/statescript/resolvers/array-resolver.md Rewritten to describe the new ArrayResolver (was previously the variable resolver).
docs/statescript/resolvers/array-variable-resolver.md New page documenting the variable-reading array resolver split out from the old file.
docs/statescript/resolvers/entity-array-resolver.md New documentation page for EntityArrayResolver.
docs/statescript/resolvers/entity-array-variable-resolver.md Updates See-Also links to reference the split docs and the new entity composite resolver.
docs/statescript/resolvers/variable-resolver.md Updates See-Also to include the new composite and variable array resolver pages.
docs/statescript/resolvers/README.md Adds rows for ArrayResolver and EntityArrayResolver and points ArrayVariableResolver at its new file.
docs/statescript/custom-resolvers.md Adds a tip recommending the built-in composite resolvers over custom implementations for simple composition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Forge/Statescript/Properties/ArrayResolver.cs Outdated
Comment thread Forge/Statescript/Properties/ReferenceArrayCompositeResolver.cs
Comment thread Forge/Statescript/Properties/ArrayResolver.cs
@lextatic lextatic merged commit aba36c5 into main May 19, 2026
1 check passed
@lextatic lextatic deleted the feature/array-resolver branch May 19, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants