-
Notifications
You must be signed in to change notification settings - Fork 140
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
Underline Syntax Errors #3700
Underline Syntax Errors #3700
Conversation
@yegor256 Could you have a look, please? |
@volodya-lombrozo the build is not clean yet, can you take a look? |
@maxonfjvipon please, check this one |
|
||
/** | ||
* Test case for {@link UnderlinedMessage}. | ||
* @since 0.1 |
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.
@volodya-lombrozo let's make it @since 0.50
* tests pass. | ||
* @return Test cases. | ||
*/ | ||
static Stream<Arguments> examples() { |
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.
@volodya-lombrozo can the method be private
?
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.
@volodya-lombrozo LGTM
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.
@volodya-lombrozo very good contribution! a few comments above though
// @checkstyle MethodBodyCommentsCheck (20 lines) | ||
// @todo #3332:30min Add more specific error messages. | ||
// Currently we write just "error: no viable alternative at input" for all errors. | ||
// It's better to use {@link #recognizer} to get more specific error messages. |
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.
@volodya-lombrozo who is #recognizer
? If I would be the resolver of this puzzle, I would be very puzzled.
|
||
/** | ||
* Underlined message. | ||
* For example, if you have a message "Problem is here" and you want to underline |
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.
@volodya-lombrozo check this out: https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html This is basically HTML. It's a good practice to use <p>
tags for paragraphs.
@yegor256 Could you have a look one more time, please? |
@volodya-lombrozo thanks a lot, this is helpful! |
In this PR I've made several useful tweaks:
UnderlinedMessage
class that underlines syntax errors (tests provide examples)It's only the first step to make error messages readable (the future steps are described in the new puzzles)
Related to #3332.