Skip to content

Return one machine per @StateSet #8

Closed

Description

@CatarinaGamboa

@StateSet is repeatable, but getStates reads only the first annotation. For ImageWriteParam, the compression states are dropped. Needed for liquid-java/vscode-liquidjava#115 and #116.

  • Return one machine per @StateSet group, labeled with its group.
  • Assign constructors, static factories, and method transitions to each group whose states they refer to.
  • Keep conditions that refer to another group as condition text. Do not drop them.
  • Attach the error context (Add the failing call's context to StateMachineErrorContext #7) only to the machines whose states appear in Found or Expected. When a condition involves two groups, attach it to both.
  • Keep parse(uri) working for current callers.

Tests

Add fixtures for:

  • two independent @StateSet groups;
  • a transition whose condition refers to another group;
  • an error whose condition involves both groups.

Activity

  1. CatarinaGamboa commented on Oct 25, 2026

    @CatarinaGamboa
    ContributorAuthor

    An update since this was written: the error context is gone from fsm (#12, released in 0.2.0), so the bullet about attaching the error context (#7) to each machine no longer applies. fsm now only draws diagrams.

    The error data now comes from the verifier's StateRefinementError#getContext() (liquid-java/liquidjava#421). It names every state by its name in each state set, in declaration order, e.g. ["tilingSet", "compressionExplicit"]. So machine i of this issue should be the i-th @StateSet, in declaration order, and the language server can map the verifier's states onto each machine without fsm reading any predicate.

    Remaining scope here:

    • Return one machine per @StateSet, in declaration order, labeled with its group.
    • Assign transitions and constructors to each group whose states they mention, and keep conditions on another group as condition text.
    • parse(uri) and parse(uri, className) keep working for current callers.

    Example: barista ImageWriteParam (tiling and compression sets). Today the compression states are dropped.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions