Add location to error messages - #941
Merged
Merged
Conversation
hugo-vrijswijk
commented
Sep 8, 2026
| location: Option[(Int, Int)] = None | ||
| ) | ||
| case class Select(name: String, alias: Option[String], child: Query) | ||
| case class Select(name: String, alias: Option[String], child: Query, location: Option[(Int, Int)] = None) |
Contributor
Author
There was a problem hiding this comment.
This is also a source-breaking change for any users that pattern-match on Select(n, a, c), but I don't know if there is a way around
Member
There was a problem hiding this comment.
I'm not too concerned about this: SelectElatorator should protect most uses from this.
Adds a `location` field `Ast.Selection.Field` to hold the line and column of the selection. That can then be used to add a `locations` field to error messages. Most changes are in tests with added `location` information to the error messages. The other option would be to strip location information from the expected error messages, but that would make it harder to verify that the location information is actually present. Fixes 2 conformance tests.
hugo-vrijswijk
force-pushed
the
fix/field-error-locations
branch
from
September 8, 2026 21:04
4f6bd0a to
eea26c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a
locationfieldAst.Selection.Fieldto hold the line and column of the selection. That can then be used to add alocationsfield to error messages.Most changes are in tests with added
locationinformation to the error messages. The other option would be to strip location information from the expected error messages, but that would make it harder to verify that the location information is actually present.Fixes 2 conformance tests.