Repository navigation
Show the transition conditions on the state machine by default - #167
Merged
Merged
Conversation
The pre and postconditions besides the states were hidden until the expand button was clicked, also when opening a state error, where they often explain why the call is rejected. Show them right away; the button still collapses them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CatarinaGamboa
added a commit
that referenced
this pull request
Oct 26, 2026
CatarinaGamboa
added a commit
that referenced
this pull request
Oct 27, 2026
The State Machine view described a state error in its own words: "`x.m()` is rejected when `x` is in state A · allowed in state B", with a legend of *Call rejected*, *Call allowed* and *Allowed, but not reachable here* for the possible and accepted states. It now uses the terms of a compiler error, as the Verification tab does (Expected / Found): - Summary: **Invalid method call `x.m()` · expected state `B` or `C` · actual state `A`** - *expected* lists every state that accepts the call (before, only the possible ones were listed, or all accepted ones when the state is unknown); *actual* lists the states the receiver may be in, or `unknown`. - with several state sets, one group per set, joined with *and*: `expected state tilingSet and compressionExplicit · actual state startTiling and compressionExplicit`. - when the error cannot be marked: *Invalid method call `x.m()`*, or *Invalid method call at line N*. - Legend: **✕ Actual state, not expected**, **✓ Actual state, expected**, **Expected state** (the dashed outline). The marks on the diagram are unchanged. | Before | After | |---|---| | <img src="https://raw.githubusercontent.com/liquid-java/vscode-liquidjava/pr-screenshots/168/before.png" width="440"> | <img src="https://raw.githubusercontent.com/liquid-java/vscode-liquidjava/pr-screenshots/168/after-tiling-state.png" width="440"> | Second error of the same file, `param.setCompressionQuality()`: <img src="https://raw.githubusercontent.com/liquid-java/vscode-liquidjava/pr-screenshots/168/after-compression-state.png" width="440"> The summary drops the receiver, which is already in the call. ## Testing - `npm run test:unit` (107 passed), `tsc -p tsconfig.test.json`, webpack build. - Checked in a headless VS Code on the `ImageWriteParam` study exercise (screenshots above). Independent of #167 (shows the conditions by default); both touch the State Machine view but not the same lines. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pre and postconditions that state refinements carry besides the states (e.g.
mode == 2onsetTilingMode) were hidden until the expand button was clicked, also when opening a state error, where they often explain why the call is rejected. The State Machine view now shows them right away, including on the transitions that stay bright when focusing on an error. The button still collapses them; opening another state error shows them again.Screenshots from a headless VS Code on the
ImageWriteParamstudy exercise (preview.setTiling()instartTiling): the brightsetTilingModearrow out of the actual state now says it only reachestilingExplicitwhenmode == 2.Changes
script.ts:showDiagramConditionsstartstrue, andshowStateErrorresets it totrueinstead offalse.script.spec.ts: the conditions are shown on first open, collapse with the button, and show again when opening a state error.Testing
npm run test:unit(108 passed),tsc -p tsconfig.test.json, webpack build.🤖 Generated with Claude Code