Skip to content

Commit 13bf7f9

Browse files
committed
Ensure getNewLineFromContext never returns undefined
1 parent 3ca1cc4 commit 13bf7f9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/services/refactorProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace ts {
2121

2222
export function getNewLineFromContext(context: RefactorOrCodeFixContext) {
2323
const formatSettings = context.formatContext.options;
24-
return formatSettings ? formatSettings.newLineCharacter : context.host.getNewLine();
24+
return (formatSettings && formatSettings.newLineCharacter) || getNewLineOrDefaultFromHost(context.host);
2525
}
2626

2727
export function toTextChangesContext(context: RefactorOrCodeFixContext): textChanges.TextChangesContext {

0 commit comments

Comments
 (0)