File tree 2 files changed +15
-9
lines changed
2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -579,17 +579,10 @@ namespace ts.formatting {
579
579
function isControlFlowEndingStatement ( kind : SyntaxKind , parent : TextRangeWithKind ) : boolean {
580
580
switch ( kind ) {
581
581
case SyntaxKind . ReturnStatement :
582
- case SyntaxKind . ThrowStatement : {
583
- if ( parent . kind !== SyntaxKind . Block ) {
584
- return true ;
585
- }
586
- const grandParent = ( parent as Node ) . parent ;
587
- // In a function, we may want to write inner functions after this.
588
- return ! ( grandParent && grandParent . kind === SyntaxKind . FunctionExpression || grandParent . kind === SyntaxKind . FunctionDeclaration ) ;
589
- }
582
+ case SyntaxKind . ThrowStatement :
590
583
case SyntaxKind . ContinueStatement :
591
584
case SyntaxKind . BreakStatement :
592
- return true ;
585
+ return parent . kind !== SyntaxKind . Block ;
593
586
default :
594
587
return false ;
595
588
}
Original file line number Diff line number Diff line change
1
+ /// <reference path='fourslash.ts'/>
2
+
3
+ //// function foo() {
4
+ //// if (true) {
5
+ //// {| "indentation": 8|}
6
+ //// return;
7
+ //// {| "indentation": 8|}
8
+ //// }
9
+ //// }
10
+
11
+ for ( const marker of test . markers ( ) ) {
12
+ verify . indentationAtPositionIs ( marker . fileName , marker . position , marker . data . indentation ) ;
13
+ }
You can’t perform that action at this time.
0 commit comments