You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* If the character value is greater than the line length it defaults back
* to the line length. This property is implementation specific.
But these cases do include the line endings:
constdocument=newDocument('A\nB\rC\r\nD');assert.equal(document.offsetAt(Positions.create(0,10)),2);assert.equal(document.offsetAt(Positions.create(1,10)),4);assert.equal(document.offsetAt(Positions.create(2,2)),6);// between \r and \nassert.equal(document.offsetAt(Positions.create(2,3)),7);assert.equal(document.offsetAt(Positions.create(2,10)),7);assert.equal(document.offsetAt(Positions.create(3,10)),8);// this should be (2, 1), I thinkassert.deepEqual(document.positionAt(6),Positions.create(2,2));// between \r and \n
I think the line length of each line is 1, so the invalid positions should be treated as (line, 1), and the correct offsets should be 1, 3, 5, 5, 5, 8 respectively
The text was updated successfully, but these errors were encountered:
The
Position
docs say that you can't specify a position between an\r
and\n
, or after a line ending:vscode-languageserver-node/textDocument/src/main.ts
Lines 19 to 20 in f2ff7d5
And that if the
character
is too big it defaults to the line length:vscode-languageserver-node/textDocument/src/main.ts
Lines 40 to 41 in f2ff7d5
But these cases do include the line endings:
I think the line length of each line is 1, so the invalid positions should be treated as
(line, 1)
, and the correct offsets should be 1, 3, 5, 5, 5, 8 respectivelyThe text was updated successfully, but these errors were encountered: