mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Rename option
This commit is contained in:
@@ -2978,7 +2978,7 @@ namespace ts.server.protocol {
|
||||
placeOpenBraceOnNewLineForFunctions?: boolean;
|
||||
placeOpenBraceOnNewLineForControlBlocks?: boolean;
|
||||
insertSpaceBeforeTypeAnnotation?: boolean;
|
||||
semicolonPreference?: SemicolonPreference
|
||||
semicolons?: SemicolonPreference;
|
||||
}
|
||||
|
||||
export interface UserPreferences {
|
||||
|
||||
@@ -313,8 +313,8 @@ namespace ts.formatting {
|
||||
|
||||
rule("SpaceBeforeTypeAnnotation", anyToken, SyntaxKind.ColonToken, [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], RuleAction.Space),
|
||||
rule("NoSpaceBeforeTypeAnnotation", anyToken, SyntaxKind.ColonToken, [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], RuleAction.DeleteTrivia),
|
||||
rule("NoOptionalSemicolon", SyntaxKind.SemicolonToken, anyTokenIncludingEOF, [optionEquals("semicolonPreference", SemicolonPreference.Remove), isSemicolonDeletionContext], RuleAction.DeleteToken),
|
||||
rule("OptionalSemicolon", anyToken, anyTokenIncludingEOF, [optionEquals("semicolonPreference", SemicolonPreference.Insert), isSemicolonInsertionContext], RuleAction.TrailingSemicolon),
|
||||
rule("NoOptionalSemicolon", SyntaxKind.SemicolonToken, anyTokenIncludingEOF, [optionEquals("semicolons", SemicolonPreference.Remove), isSemicolonDeletionContext], RuleAction.DeleteToken),
|
||||
rule("OptionalSemicolon", anyToken, anyTokenIncludingEOF, [optionEquals("semicolons", SemicolonPreference.Insert), isSemicolonInsertionContext], RuleAction.TrailingSemicolon),
|
||||
];
|
||||
|
||||
// These rules are lower in priority than user-configurable. Rules earlier in this list have priority over rules later in the list.
|
||||
|
||||
@@ -838,7 +838,7 @@ namespace ts.textChanges {
|
||||
// If the user has no semicolon preference defined and the file doesn’t use semicolons,
|
||||
// make the formatter remove them. Otherwise, ignore semicolons in the formatter because
|
||||
// the writer will insert them by default.
|
||||
semicolonPreference: context.options.semicolonPreference === SemicolonPreference.Remove || (!context.options.semicolonPreference || context.options.semicolonPreference === SemicolonPreference.Ignore) && !probablyUsesSemicolons(sourceFile)
|
||||
semicolons: context.options.semicolons === SemicolonPreference.Remove || (!context.options.semicolons || context.options.semicolons === SemicolonPreference.Ignore) && !probablyUsesSemicolons(sourceFile)
|
||||
? SemicolonPreference.Remove
|
||||
: SemicolonPreference.Ignore,
|
||||
};
|
||||
|
||||
@@ -740,7 +740,7 @@ namespace ts {
|
||||
readonly placeOpenBraceOnNewLineForControlBlocks?: boolean;
|
||||
readonly insertSpaceBeforeTypeAnnotation?: boolean;
|
||||
readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
|
||||
readonly semicolonPreference?: SemicolonPreference;
|
||||
readonly semicolons?: SemicolonPreference;
|
||||
}
|
||||
|
||||
export function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings {
|
||||
@@ -764,7 +764,7 @@ namespace ts {
|
||||
insertSpaceBeforeFunctionParenthesis: false,
|
||||
placeOpenBraceOnNewLineForFunctions: false,
|
||||
placeOpenBraceOnNewLineForControlBlocks: false,
|
||||
semicolonPreference: SemicolonPreference.Ignore,
|
||||
semicolons: SemicolonPreference.Ignore,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user