Skip to content

Commit 90923e2

Browse files
committed
Make FormattingHost required again
1 parent ab09d67 commit 90923e2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/services/formatting/formatting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace ts.formatting {
33
export interface FormatContext {
44
readonly options: FormatCodeSettings;
55
readonly getRules: RulesMap;
6-
readonly host?: FormattingHost;
6+
readonly host: FormattingHost;
77
}
88

99
export interface TextRangeWithKind<T extends SyntaxKind = SyntaxKind> extends TextRange {

src/services/utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,9 +2085,9 @@ namespace ts {
20852085
/**
20862086
* The default is CRLF.
20872087
*/
2088-
export function getNewLineOrDefaultFromHost(host: FormattingHost | undefined, formatSettings?: FormatCodeSettings) {
2088+
export function getNewLineOrDefaultFromHost(host: FormattingHost, formatSettings?: FormatCodeSettings) {
20892089
return formatSettings?.newLineCharacter ||
2090-
host?.getNewLine?.() ||
2090+
host.getNewLine?.() ||
20912091
carriageReturnLineFeed;
20922092
}
20932093

0 commit comments

Comments
 (0)