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

This commit is contained in:
Nathan Shively-Sanders authored and GitHub committed 2018-12-04 12:45:00 -08:00
1 parent c85460bc44
commit ee987a25e2
2 files changed
+15 -4

No files matched your search

+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;
}`);