@@ -128,10 +128,6 @@ namespace ts.formatting {
128
128
if ( actualIndentation !== Value . Unknown ) {
129
129
return actualIndentation ;
130
130
}
131
- actualIndentation = getLineIndentationWhenExpressionIsInMultiLine ( current , sourceFile , options ) ;
132
- if ( actualIndentation !== Value . Unknown ) {
133
- return actualIndentation + options . indentSize ! ; // TODO: GH#18217
134
- }
135
131
136
132
previous = current ;
137
133
current = current . parent ;
@@ -188,10 +184,6 @@ namespace ts.formatting {
188
184
if ( actualIndentation !== Value . Unknown ) {
189
185
return actualIndentation + indentationDelta ;
190
186
}
191
- actualIndentation = getLineIndentationWhenExpressionIsInMultiLine ( current , sourceFile , options ) ;
192
- if ( actualIndentation !== Value . Unknown ) {
193
- return actualIndentation + indentationDelta ;
194
- }
195
187
}
196
188
197
189
// increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line
@@ -388,49 +380,6 @@ namespace ts.formatting {
388
380
return Value . Unknown ;
389
381
}
390
382
391
- function getLineIndentationWhenExpressionIsInMultiLine ( node : Node , sourceFile : SourceFile , options : EditorSettings ) : number {
392
- // actual indentation should not be used when:
393
- // - node is close parenthesis - this is the end of the expression
394
- if ( node . kind === SyntaxKind . CloseParenToken ) {
395
- return Value . Unknown ;
396
- }
397
-
398
- if ( node . parent && isCallOrNewExpression ( node . parent ) && node . parent . expression !== node ) {
399
- const fullCallOrNewExpression = node . parent . expression ;
400
- const startingExpression = getStartingExpression ( fullCallOrNewExpression ) ;
401
-
402
- if ( fullCallOrNewExpression === startingExpression ) {
403
- return Value . Unknown ;
404
- }
405
-
406
- const fullCallOrNewExpressionEnd = sourceFile . getLineAndCharacterOfPosition ( fullCallOrNewExpression . end ) ;
407
- const startingExpressionEnd = sourceFile . getLineAndCharacterOfPosition ( startingExpression . end ) ;
408
-
409
- if ( fullCallOrNewExpressionEnd . line === startingExpressionEnd . line ) {
410
- return Value . Unknown ;
411
- }
412
-
413
- return findColumnForFirstNonWhitespaceCharacterInLine ( fullCallOrNewExpressionEnd , sourceFile , options ) ;
414
- }
415
-
416
- return Value . Unknown ;
417
-
418
- function getStartingExpression ( node : Expression ) {
419
- while ( true ) {
420
- switch ( node . kind ) {
421
- case SyntaxKind . CallExpression :
422
- case SyntaxKind . NewExpression :
423
- case SyntaxKind . PropertyAccessExpression :
424
- case SyntaxKind . ElementAccessExpression :
425
- node = ( < PropertyAccessExpression | CallExpression | NewExpression | ElementAccessExpression | PropertyAccessExpression > node ) . expression ;
426
- break ;
427
- default :
428
- return node ;
429
- }
430
- }
431
- }
432
- }
433
-
434
383
function deriveActualIndentationFromList ( list : ReadonlyArray < Node > , index : number , sourceFile : SourceFile , options : EditorSettings ) : number {
435
384
Debug . assert ( index >= 0 && index < list . length ) ;
436
385
const node = list [ index ] ;
0 commit comments