Skip to content

Add the failing call's context to StateMachineErrorContext #7

Closed

Description

@CatarinaGamboa

The vscode-liquidjava State Machine view needs more context about a failing call than the parser provides (liquid-java/vscode-liquidjava#117, #155). Support for multiple @StateSet groups is tracked separately in #8.

Error context for the failing call

StateMachineErrorContext holds only calledMethod and actualStates. Keep both and add:

  • receiver: the receiver of the failing call;
  • expectedStates: the required states from the Expected condition;
  • expectedCondition: the Expected condition as text;
  • foundCondition: the Found condition for the receiver, as text;
  • definiteFoundState: the one Found state, only when Found establishes a single definite state; otherwise null.

Identify the called method by its declaration position, not by label text. Constructors and static factories should also be matched.

Tests

Add fixtures for:

  • the DefaultMutableTreeNode example from vscode-liquidjava#117: Found childrenAllowed, required maybeHasChildren;
  • a precondition that accepts more than one state;
  • a Found condition that does not establish one state.

Activity

  1. changed the title [-]Return one machine per @StateSet with call error context[/-] [+]Add the failing call's context to StateMachineErrorContext[/+] on Oct 20, 2026
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