Merged
Conversation
CatarinaGamboa
approved these changes
Nov 5, 2025
Collaborator
CatarinaGamboa
left a comment
There was a problem hiding this comment.
LGTM and the next steps seem great - thanks for splitting the change in multiple PRs!
Lets just add some javadoc to the multiple types of errors you created so everyone can understand when to use each type of error
| import spoon.reflect.cu.SourcePosition; | ||
| import spoon.reflect.declaration.CtElement; | ||
|
|
||
| // base class for all LiquidJava errors |
Collaborator
There was a problem hiding this comment.
you can have this comment as proper javadoc
|
|
||
| import spoon.reflect.declaration.CtElement; | ||
|
|
||
| // e.g. when a variable used in a refinement is not found |
Collaborator
There was a problem hiding this comment.
same here, lets specify when we are supposed to use each type of error like what you had in the PR description
Collaborator
Author
|
Will do! |
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.
This PR adds a class for each type of error, instead of mapping all errors to strings. Warnings were also introduced. This change will make diagnostics more structured, extensible and easier to manage, which the VS Code extension will benefit from.
Changes
toStringimplementationLJErrorRefinementError- when a refinement is violatedStateRefinementError- when a state refinement is violatedNotFoundError- when an element is not foundSyntaxError- when the syntax is invalidGhostInvocationError- when a ghost call as wrong argumentsStateConflictError- when states are disjointIllegalConstructorTransitionError- when state refinement in constructor hasfromtransitionInvalidRefinementError- when refinement is semantically invalid (e.g., not a boolean expression)CustomError- any other errorLJWarningExternalClassNotFoundWarning- when class in external refinement is not foundExternalMethodNotFoundWarning- when method in class of external refinement is not founderrorsfolder todiagnosticsNext Steps
LJDiagnosticswill replace theErrorEmitterErrorHandlerwill no longer be needed