-
Notifications
You must be signed in to change notification settings - Fork 33
Add Diagnostics Classes #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CatarinaGamboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, lets specify when we are supposed to use each type of error like what you had in the PR description
|
Will do! |
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