Merged
Conversation
ghost
commented
Jul 7, 2017
| const lac = ts.computeLineAndCharacterOfPosition(lineMap, rsa[i]); | ||
| assert.equal(lac.line + 1, lp.line, "Line number mismatch " + (lac.line + 1) + " " + lp.line + " " + i); | ||
| assert.equal(lac.character, (lp.offset), "Charachter offset mismatch " + lac.character + " " + lp.offset + " " + i); | ||
| assert.equal(lac.character, lp.offset - 1, "Character offset mismatch " + lac.character + " " + (lp.offset - 1) + " " + i); |
Author
There was a problem hiding this comment.
Change is intentional -- positionToLineOffset used to return a one-based line and zero-based column, which was confusing.
This was referenced Jul 7, 2017
Author
|
Tests fixed by #17020. |
sheetalkamat
approved these changes
Jul 10, 2017
This pull request was closed.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We were using the term "offset" to mean many different things:
We were also using the
ILineInfotype in many unrelated situations. There was no case where we needed every field.This PR switches us to using some clearer terminology. Every time the
protocol.Locationtype is used, it is assumed that we are dealing with a 1-based line and 1-based column. Elsewhere we use explicit names such asrelativeOneBasedLine.