Class PdeIssueEmitter.IssueMessageSimplification
- Enclosing class:
- PdeIssueEmitter
Data structure describing an edit that was made to an error message or warning to be shown to the user based on a series of rules that attempts to make error messages easier to understand for the user.
-
Constructor Summary
ConstructorsConstructorDescriptionIssueMessageSimplification(String newMessage) Create a new issue message simplification.IssueMessageSimplification(String newMessage, boolean newAttributeToPriorToken) Create a new issue message simplification. -
Method Summary
Modifier and TypeMethodDescriptionbooleanFlag indicating if the error should be attributed to the prior token.Get the error message text that should be shown to the user.
-
Constructor Details
-
IssueMessageSimplification
Create a new issue message simplification.Create a new issue message simplification that leaves the token attribution alone (the token on which the error was reported will be the same before error message simplification).
- Parameters:
newMessage- The message to show to the user.
-
IssueMessageSimplification
Create a new issue message simplification.Create a new issue message simplification. Note that there is an option to have the error attributed to the "prior token". This is helpful, for example, when a semicolon is missing. The error is generated on the token after the line on which the semicolon was omitted so, while the error technically emerges on the next line, it is better for the user for it to appear earlier. Specifically, it is most sensible for it to appear on the "prior token".
- Parameters:
newMessage- The message to show to the user.newAttributeToPriorToken- Boolean flag indicating if the error should be shown on the token prior to the one on which the error was originally generated. True if the error should be attributed to the prior token. False otherwise.
-
-
Method Details
-
getMessage
Get the error message text that should be shown to the user.- Returns:
- The error message text that should be shown to the user.
-
getAttributeToPriorToken
public boolean getAttributeToPriorToken()Flag indicating if the error should be attributed to the prior token.- Returns:
- True if the error should be attributed to the prior non-skip token (not whitepsace or comment). This is useful when a mistake on a prior line like omitted semicolon causes an error on a later line but one wants error highlighting closer to the mistake itself. False if the error should be attributed to the original offending token.
-