mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Revert over-eager bailout when trailing whitespace (#28848)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
}`);
|
||||
Reference in New Issue
Block a user