Repository navigation
Fix import source locations - #815
Merged
Merged
Conversation
.. as caught by @Profpatsch in: #812 (comment) Before this change the location was always being reported as `(stdin):1:1` because the `SourcedException` kept getting modified with a broader source location in the `Note` branch of `loadWith`. This was originally done so that alternative imports would show the entire source span, but it mistakenly just kept bubbling up regardless of whether or not there were alternative imports. Instead, this includes an approximate source span for alternative imports. The source span bounds are correct but the contents just show which imports were alternated, even if they might have been buried in a larger expression. For example, if the original expression had been: ```haskell Some ./x ? None ./y ``` ... then the source span for the error message would display just: ```haskell ./x ? ./y ``` ... which is probably as good as it will get for now.
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.
.. as caught by @Profpatsch in:
#812 (comment)
Before this change the location was always being reported as
(stdin):1:1because the
SourcedExceptionkept getting modified with a broadersource location in the
Notebranch ofloadWith.This was originally done so that alternative imports would show the entire
source span, but it mistakenly just kept bubbling up regardless of whether or
not there were alternative imports.
Instead, this includes an approximate source span for alternative imports.
The source span bounds are correct but the contents just show which imports
were alternated, even if they might have been buried in a larger expression.
For example, if the original expression had been:
... then the source span for the error message would display just:
... which is probably as good as it will get for now.