Record constructor signatures on initial state transitions - #1
Open
CatarinaGamboa wants to merge 1 commit into
Open
CatarinaGamboa wants to merge 1 commit into
CatarinaGamboa wants to merge 1 commit into
Conversation
rcosta358
reviewed
Oct 1, 2026
| String className, String firstState) { | ||
| Collection<? extends CtExecutable<?>> constructors = getConstructorElements(ctType, className); | ||
| if (constructors.isEmpty()) { | ||
| String implicitConstructor = ctType instanceof CtClass<?> ? "new " + className + "()" : null; |
Collaborator
Contributor
Author
There was a problem hiding this comment.
i think this is the most accurate description, but its true that it might be a bit verbose, I would say to keep this and then see if its too verbose for the most complex examples we can reduce it
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.

Summary
Record the constructor signature on each initial state transition so the VS Code diagram can show which constructor leads to each state. This covers overloaded constructors, conditional constructor postconditions, interface declarations for external refinements, and constructors that use the default first state.
Supports liquid-java/vscode-liquidjava#112. The matching extension change is in a separate PR.
Verification
mvn testpassed: 20 tests, including overloaded constructors that reach the same state and constructors without explicit state annotations.new MultipleInitialStates()andnew MultipleInitialStates(int)on their respective arrows.Integration note
The extension currently depends on the published
liquidjava-fsm0.1.0 artifact. For local end-to-end testing, install this branch withmvn installbefore rebuilding the extension server. A new FSM artifact version and corresponding server dependency update will be needed before the extension change can be released.