Skip to content

[BUG] State Transition View: states render but no transition edges — transition symbols lack source/target #84

Description

@devilcoder

Environment

  • Extension v0.45.0 (sysml-v2-lsp 0.24.0), VS Code on macOS

Symptom

The State Transition View renders every state of a state machine, but no transition edges — the states float unconnected. Reproduced with a real 8-state / 14-transition machine and with this minimal model:

package Demo {
    state def Machine {
        entry; then a;
        state a;
        state b;
        transition first a then b;
    }
}

The MCP server's preview (diagramType: "state") also emits zero --> arrows for the same model (that path additionally omits the nested states themselves — it renders only the empty state def container and any exhibit state usage).

Root cause (visible via getSymbols)

Transition symbols carry no source/target information — and an anonymous transition first a then b; is recorded with the source state's name as its own name:

{"name": "a", "kind": "transition", "qualifiedName": "Demo::Machine::a", "parent": "Demo::Machine"}

Note this also collides with the state a's qualified name — Demo::Machine::a now denotes both a state and a transition. A named transition (transition aToB first a then b;) gets its proper name but still no endpoints. With neither endpoint recorded, no renderer can draw an edge, regardless of transition syntax.

Suggestion

Record source and target (the first/then references) on transition symbols, name anonymous transitions distinctly (e.g. a_to_b) to avoid qualified-name collisions with their source state, and have the State view build edges from those fields. Possibly related: #60 (closed) fixed transition links in an earlier version — either this regressed or that fix covered a different path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions