Rename option

This commit is contained in:
Andrew Branch
2019-09-12 09:47:22 -07:00
parent 4555bb815b
commit ac30127317
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -2978,7 +2978,7 @@ namespace ts.server.protocol {
placeOpenBraceOnNewLineForFunctions?: boolean;
placeOpenBraceOnNewLineForControlBlocks?: boolean;
insertSpaceBeforeTypeAnnotation?: boolean;
semicolonPreference?: SemicolonPreference
semicolons?: SemicolonPreference;
}
export interface UserPreferences {
+2 -2
View File
@@ -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.
+1 -1
View File
@@ -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,
};
+2 -2
View File
@@ -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,
};
}