mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
fix(39047): handle extra spaces after the catch statement (#39306)
This commit is contained in:
@@ -348,8 +348,8 @@ namespace ts.formatting {
|
||||
anyToken,
|
||||
[isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext],
|
||||
RuleAction.InsertSpace),
|
||||
// This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
|
||||
rule("SpaceAfterTryFinally", [SyntaxKind.TryKeyword, SyntaxKind.FinallyKeyword], SyntaxKind.OpenBraceToken, [isNonJsxSameLineTokenContext], RuleAction.InsertSpace),
|
||||
// This low-pri rule takes care of "try {", "catch {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter.
|
||||
rule("SpaceAfterTryCatchFinally", [SyntaxKind.TryKeyword, SyntaxKind.CatchKeyword, SyntaxKind.FinallyKeyword], SyntaxKind.OpenBraceToken, [isNonJsxSameLineTokenContext], RuleAction.InsertSpace),
|
||||
];
|
||||
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user