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
Fix bad line number assertion in ScriptInfo.positionToLineOffset
This is the line number side of ecddf84 (from microsoft#21924, fixing microsoft#21818).
But the code is slightly improved for both cases: instead of testing
that `leaf` is defined, check whether `lineCount` is zero, and if it is,
return `〈1,0〉` for the one-based line and zero-based column numbers.
(The requirement of `lineCount > 0` is also seen in the fact
that `lineNumberToInfo` expects a "*One*BasedLine" argument.)
I've stared at this code way too much, since I think that there is
something more fundamentally wrong here. E.g., `EditWalker` only
`push`es to `startPath` but never pops even a `children`-less node that
is left after deleting the whole contents. But I can't figure out the
overall structure, which is also why the test that I added is not
great (see the comment there; also, microsoft#21924 is dealing with the same
problem and didn't add a test).
Fixesmicrosoft#44518.
0 commit comments