Revert over-eager bailout when trailing whitespace (#28848)

This commit is contained in:
Nathan Shively-Sanders
2018-12-04 12:47:52 -08:00
parent 7c397f7a65
commit a621df0d83
2 changed files with 15 additions and 4 deletions
+1 -4
View File
@@ -1106,10 +1106,7 @@ namespace ts.formatting {
* Trimming will be done for lines after the previous range
*/
function trimTrailingWhitespacesForRemainingRange() {
if (!previousRange) {
return;
}
const startPosition = previousRange.end;
const startPosition = previousRange ? previousRange.end : originalRange.pos;
const startLine = sourceFile.getLineAndCharacterOfPosition(startPosition).line;
const endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line;
@@ -0,0 +1,14 @@
/// <reference path="fourslash.ts" />
////function foo()
////{
//// var bar;
//// /*1*/
////}
goTo.marker('1')
edit.insertLine("");
verify.currentFileContentIs(`function foo()
{
var bar;
}`);