diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 40cb764f29..debf1702b4 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -80,7 +80,7 @@ namespace ts.formatting { rule("SpaceAfterSubtractWhenFollowedByUnaryMinus", SyntaxKind.MinusToken, SyntaxKind.MinusToken, [isNonJsxSameLineTokenContext, isBinaryOpContext], RuleAction.Space), rule("SpaceAfterSubtractWhenFollowedByPredecrement", SyntaxKind.MinusToken, SyntaxKind.MinusMinusToken, [isNonJsxSameLineTokenContext, isBinaryOpContext], RuleAction.Space), - rule("NoSpaceAfterCloseBrace", SyntaxKind.CloseBraceToken, [SyntaxKind.CloseBracketToken, SyntaxKind.CommaToken, SyntaxKind.SemicolonToken], [isNonJsxSameLineTokenContext], RuleAction.Delete), + rule("NoSpaceAfterCloseBrace", SyntaxKind.CloseBraceToken, [SyntaxKind.CommaToken, SyntaxKind.SemicolonToken], [isNonJsxSameLineTokenContext], RuleAction.Delete), // For functions and control block place } on a new line [multi-line rule] rule("NewLineBeforeCloseBraceInBlockContext", anyTokenIncludingMultilineComments, SyntaxKind.CloseBraceToken, [isMultilineBlockContext], RuleAction.NewLine), diff --git a/tests/cases/fourslash/formatInsertSpaceAfterCloseBraceBeforeCloseBracket.ts b/tests/cases/fourslash/formatInsertSpaceAfterCloseBraceBeforeCloseBracket.ts new file mode 100644 index 0000000000..c7df70734b --- /dev/null +++ b/tests/cases/fourslash/formatInsertSpaceAfterCloseBraceBeforeCloseBracket.ts @@ -0,0 +1,7 @@ +/// + +////[{}] + +format.setOption("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", true); +format.document(); +verify.currentFileContentIs("[ {} ]");