Skip to content

Highlight state errors in the relevant @StateSet diagram #116

Open

Description

@CatarinaGamboa

When a class has multiple @StateSet groups and the State Machine view shows one diagram per group (#115), “View error on state machine” should bring the relevant diagram into view and highlight the failing call there.

For example, if ImageWriteParam.setTiling(...) fails because of a tiling state, highlight the relevant state and transition in the tiling diagram; leave the compression diagram unhighlighted. If a failed condition involves both state sets, show the relevant error context in both diagrams.

Keep the existing error highlighting behavior for classes with one state set.

Activity

  1. CatarinaGamboa commented on Oct 25, 2026

    @CatarinaGamboa
    CollaboratorAuthor

    An update on where the data comes from: the verifier's StateErrorContext (liquid-java/liquidjava#421) gives the receiver's possible states and the states that allow the call. Each state is a list with one name per @StateSet, in declaration order, so the i-th name belongs to diagram i (liquid-java/liquidjava-fsm#8).

    To keep the highlighting from ever being false when several sets are combined:

    • In diagram i, a state is possible if some possible combination has it at position i.
    • It is valid (✓) only if every possible combination with that state is accepted. It is invalid (✕) only if none is. Otherwise it is left unmarked.
    • With one state set these rules give the current exact highlighting.

    The upcoming vscode PR (verifier 0.0.36 and fsm 0.2.0) applies these rules to the first set, the one diagram shown today. This issue extends them to every diagram.

    🤖 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions