Skip to content

Commit d1d9174

Browse files
committed
fix suffix newline
1 parent 9176b4a commit d1d9174

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/services/textChanges.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ export class ChangeTracker {
645645
const pos = sourceFile.end + 1;
646646
const options = {
647647
prefix: this.newLineCharacter,
648-
suffix: blankLineBetween ? this.newLineCharacter : "",
648+
suffix: this.newLineCharacter + (blankLineBetween ? this.newLineCharacter : ""),
649649
};
650650
this.insertNodesAt(sourceFile, pos, insert, options);
651651
}

tests/cases/fourslash/moveToFile_blankExistingFile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import { p } from './a';
2525
import { b } from "./other";
2626
2727
28-
const y: Date = p + b;`,
28+
const y: Date = p + b;
29+
`,
2930
},
3031
interactiveRefactorArguments: {targetFile: "/bar.ts"},
3132
});

tests/cases/fourslash/moveToFile_differentDirectories2.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ y;`,
2828
import { b } from "../dir1/other";
2929
3030
31-
export const y = b + a;`,
31+
export const y = b + a;
32+
`,
3233
},
3334
interactiveRefactorArguments: { targetFile: "/src/dir2/bar.ts" }
3435
});

0 commit comments

Comments
 (0)