Repository navigation
Range mappings: test newline with non-zero original column - #46
Open
jessealama wants to merge 1 commit into
Open
jessealama wants to merge 1 commit into
jessealama wants to merge 1 commit into
Conversation
The `rangeMappingsNewline` test maps a range to original column 0, so it can't help us distinguish how the original column is computed for positions on later lines of a multi-line range. Add a test that starts the range at a non-zero original column.
Contributor
Author
|
A question this test raises: when a generated position falls inside a range mapping, but on a later line than the one where the range starts, what should the original column be? I can see three possibilities:
Our existing newline test is compatible with the first two, because its range starts at original column 0. The new test in this PR expects (1): a range mapping says the text is identical on both sides, and after a newline both sides restart at column 0, so the columns should line up directly. I'm not sure that is the intended rule. It seems that the trace-mapping library currently implements (2). But if I understand the |
Member
|
I'm pretty sure it should be (1). |
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.
The
rangeMappingsNewlinetest maps a range to original column 0, so it can't help us distinguish how the original column is computed for positions on later lines of a multi-line range. Add a test that starts the range at a non-zero original column.