Repository navigation
Draw a StateRefinement without from only from the states it leaves uncovered - #19
Merged
Merged
Conversation
…covered A StateRefinement with a to but no from was also drawn from the initial pseudo state, like a constructor, when the method had other StateRefinements with from. The verifier reads it as from = true, so it already goes from the states the others do not cover; only constructors and factory methods enter the state machine. entryTransitions is kept, always empty, so that clients still compile. Closes #18 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Codex review, round 1 (
No findings, so there is nothing to fix. |
…beside others Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Clean-code audit (clean-code-principles skill, on the diff against
|
Contributor
Author
|
Codex review, round 2 (after the fixture rename)
No findings. The review loop is done. |
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.
Closes #18
What changes
A
@StateRefinementwith atobut nofromis no longer drawn from the start node. Only constructors and factory methods come from there now.In the verifier (
AuxStateHandler.getStates), atowithoutfromgetsfrom = true: the method can be called in any state and moves toto.changeStateuses the first alternative whosefrommatches, so the from-less one applies in every state that the earlierfrom=alternatives do not cover. The parser already drew exactly those edges (since #15). So the fix only drops the extra arrow from the start node. The arrow stood for "an object whose state is unknown (a field, a parameter)". That case is not a state in the diagram, and next tonew UndoManager()it reads as a second way to create the object.A from-less
@StateRefinementthat is the only one on its method still goes from every state. Nothing changes forToOnlyTransition.API
I kept
StateMachine.entryTransitionsandStateMachineEntryTransition, both@Deprecatedand always empty. That way 0.2.4 is a drop-in patch: the VS Code server'sStateMachineDTOstill compiles, and its client draws nothing for an empty list. No vscode-liquidjava change is needed. Removing the record, the DTO field and the client's entry-transition drawing (diagram.ts,fsm.ts) can be a follow-up once vscode-liquidjava#180 has landed, since that work is in the same files.A1_56 (UndoManager),
redostate setcanRedo()is a query whose return value tells the state:Parsed state machine (
canUndo/canRedolines only;undois the same withcanUndo):[*] -> notRedoable : new UndoManager()[*] -> redoable : canRedo [return][*] -> notRedoable : canRedo [!return][*] -> notRedoable : new UndoManager()redoable -> redoable : canRedo [return]notRedoable -> redoable : canRedo [return]notRedoable -> notRedoable : canRedo [!return]Rendered in VS Code (vscode-liquidjava
mainwith fsm 0.2.3, then the same build with this branch's classes), focused on the state error:All methods:
canRedo [return]fromnotRedoabletoredoableis the guard that the verifier's hint suggests (if (um.canRedo()) um.redo();). In the focused view it is in the collapsed "2 methods" on that edge.Tests
testEntryTransitionis nowtestNoFromBesideFromIsNotEntryTransition. It keeps the same edges, renames the fixture fromEntryTransitiontoNoFromBesideFrom, and asserts no entry transitions. It fails onmain, which returns[canUndo -> endDone, reset -> start].testToOnlyTransitionHasNoEntryTransition.entryTransitionsis always empty now, so that test no longer checks anything.mvn -B test: 32 tests, 0 failures.🤖 Generated with Claude Code