Fix cursor location for displaying compiler errors and info. #2136
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.
In PR #2039 (explicit partial calls), one of the changes I made was
to make it so that the cursor, when reporting on an error for a token
that was missing (like the missing '?' for an explicit partial call),
would be placed under the token to the left of where the missing
token should be, instead of under the token to the right (which
was often on the next line).
However, in doing this, I accidentally made it so that many other
(non-missing) tokens were also being reported one token to the left
instead of under the actual token itself. For example:
Which should be displayed as:
This PR fixes the accidental breakage, while retaining the desired
behaviour introduced in PR #2039, so that the "explicit partial calls"
migration script will still work correctly. Now all tokens should be
reported in the correct position when displaying errors.