We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ae98d0 commit 2c3be44Copy full SHA for 2c3be44
src/services/formatting/smartIndenter.ts
@@ -729,6 +729,11 @@ export namespace SmartIndenter {
729
return false;
730
}
731
break;
732
+ case SyntaxKind.TryStatement:
733
+ if (childKind === SyntaxKind.Block) {
734
+ return false;
735
+ }
736
+ break;
737
738
// No explicit rule for given nodes so the result will follow the default value argument
739
return indentByDefault;
tests/cases/fourslash/formatTryFinally.ts
@@ -0,0 +1,15 @@
1
+/// <reference path="fourslash.ts"/>
2
+
3
+////if (true) try {
4
+//// // ...
5
+////} finally {
6
7
+////}
8
9
+format.document();
10
+verify.currentFileContentIs(
11
+`if (true) try {
12
+ // ...
13
+} finally {
14
15
+}`);
0 commit comments