Repository navigation
Record constructor signatures on initial state transitions - #1
Merged
Merged
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
rcosta358
approved these changes
Oct 5, 2026
CatarinaGamboa
added a commit
to liquid-java/vscode-liquidjava
that referenced
this pull request
Oct 20, 2026
## Summary Show the constructor signature on each initial state machine arrow. Keep conditional postconditions available under the existing Expand Conditions toggle, and accept responses from older servers that lack signature metadata. Implements the diagram side of #112. Parser metadata comes from liquid-java/liquidjava-fsm#1. ## Verification - Client webpack compile and server Maven build passed. - Headless VS Code diagnostic smoke test passed. - In a live VS Code webview built with the FSM parser branch, the state machine rendered `new MultipleInitialStates()` and `new MultipleInitialStates(int)` on separate initial arrows. ## Local review 1. Check out liquid-java/liquidjava-fsm#1 and run `mvn install` there. 2. Check out this PR, then run `npm ci` and `npm run build:server` in `client`. 3. Open `client` in VS Code and press F5. In the Extension Development Host, open a Java class with overloaded state-refined constructors and view its State Machine tab. The server still pins the published FSM 0.1.0 dependency. Maven must use the locally installed parser build for this test; a new FSM artifact version and server dependency update are needed before release. --------- Co-authored-by: Claude Opus 5.5 (1M context) <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.

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.