mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make FormattingHost required again
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user