Fix smart select on last blank line of file (#32544)

* Fix SmartSelection on last blank line of file

* Add baseline
This commit is contained in:
Andrew Branch
2019-07-25 09:47:57 -07:00
committed by GitHub
parent e8966ce033
commit aa12ec440c
3 changed files with 17 additions and 0 deletions

View File

@@ -64,6 +64,13 @@ namespace ts.SmartSelectionRange {
parentNode = node;
break;
}
// If we made it to the end of the for loop, were done.
// In practice, Ive only seen this happen at the very end
// of a SourceFile.
if (i === children.length - 1) {
break outer;
}
}
}