Skip to content

Commit

Permalink
Make FormattingHost required again
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed May 14, 2020
1 parent ab09d67 commit 90923e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/services/formatting/formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace ts.formatting {
export interface FormatContext {
readonly options: FormatCodeSettings;
readonly getRules: RulesMap;
readonly host?: FormattingHost;
readonly host: FormattingHost;
}

export interface TextRangeWithKind<T extends SyntaxKind = SyntaxKind> extends TextRange {
Expand Down
4 changes: 2 additions & 2 deletions src/services/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2085,9 +2085,9 @@ namespace ts {
/**
* The default is CRLF.
*/
export function getNewLineOrDefaultFromHost(host: FormattingHost | undefined, formatSettings?: FormatCodeSettings) {
export function getNewLineOrDefaultFromHost(host: FormattingHost, formatSettings?: FormatCodeSettings) {
return formatSettings?.newLineCharacter ||
host?.getNewLine?.() ||
host.getNewLine?.() ||
carriageReturnLineFeed;
}

Expand Down

0 comments on commit 90923e2

Please sign in to comment.