-
Notifications
You must be signed in to change notification settings - Fork 202
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
highlight line should handle case where size == 0 #785
Comments
Some other languages also don't render it:
but some languages do:
I think it's ok to change it. A few options:
Option 1 seems to be the best if nobody relies on this behavior. @mbj @palkan do you remember any places in your code using it? For rubocop we'll know it from CI 😄 @rubys Feel free to send a PR (if not I'll do it myself in a few days). |
I actually don't believe that any change to the tokens currently emitted is needed. At the moment,
Given this information, all that needs to be decided is:
|
Nope 🙂 |
@rubys Yes, but then how can you know when this custom rule should be applied? If we apply it to all zero-length ranges we can easily miss some bugs for other diagnostic messages. Same for
I'd use caret.
Agree, so for
|
Reproduction instructions:
Note the blank line where there should be either a caret or a tilde indicating the spot of the error.
The code in question is in Parser::Diagnostic::render_line.
I'd submit a pull request, but it isn't clear to me whether the code should be putting out a caret or a tilde in this case. I have verified that
column_range.begin_pos
is the spot immediately after the end of the line in this case.The text was updated successfully, but these errors were encountered: