Skip to content

Commit

Permalink
fix suffix newline
Browse files Browse the repository at this point in the history
  • Loading branch information
gabritto committed May 23, 2023
1 parent 9176b4a commit d1d9174
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/services/textChanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ export class ChangeTracker {
const pos = sourceFile.end + 1;
const options = {
prefix: this.newLineCharacter,
suffix: blankLineBetween ? this.newLineCharacter : "",
suffix: this.newLineCharacter + (blankLineBetween ? this.newLineCharacter : ""),
};
this.insertNodesAt(sourceFile, pos, insert, options);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToFile_blankExistingFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import { p } from './a';
import { b } from "./other";
const y: Date = p + b;`,
const y: Date = p + b;
`,
},
interactiveRefactorArguments: {targetFile: "/bar.ts"},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToFile_differentDirectories2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ y;`,
import { b } from "../dir1/other";
export const y = b + a;`,
export const y = b + a;
`,
},
interactiveRefactorArguments: { targetFile: "/src/dir2/bar.ts" }
});

0 comments on commit d1d9174

Please sign in to comment.