@@ -35,22 +35,22 @@ module ts.formatting {
35
35
}
36
36
}
37
37
38
- // try to find the node that will include 'position' starting from 'precedingToken'
38
+ // try to find node that can contribute to indentation and includes 'position' starting from 'precedingToken'
39
39
// if such node is found - compute initial indentation for 'position' inside this node
40
40
var previous : Node ;
41
41
var current = precedingToken ;
42
42
var currentStart : LineAndCharacter ;
43
43
var indentation : number ;
44
44
45
45
while ( current ) {
46
- if ( isPositionBelongToNode ( current , position , sourceFile ) ) {
46
+ if ( isPositionBelongToNode ( current , position , sourceFile ) && isNodeContentIndented ( current , previous ) ) {
47
47
currentStart = getStartLineAndCharacterForNode ( current , sourceFile ) ;
48
48
49
49
if ( discardInitialIndentationIfNextTokenIsOpenOrCloseBrace ( precedingToken , current , lineAtPosition , sourceFile ) ) {
50
50
indentation = 0 ;
51
51
}
52
52
else {
53
- indentation = isNodeContentIndented ( current , previous ) && lineAtPosition !== currentStart . line ? options . indentSpaces : 0 ;
53
+ indentation = lineAtPosition !== currentStart . line ? options . indentSpaces : 0 ;
54
54
}
55
55
56
56
break ;
@@ -444,7 +444,6 @@ module ts.formatting {
444
444
case SyntaxKind . DefaultClause :
445
445
case SyntaxKind . CaseClause :
446
446
case SyntaxKind . ParenExpression :
447
- case SyntaxKind . BinaryExpression :
448
447
case SyntaxKind . CallExpression :
449
448
case SyntaxKind . NewExpression :
450
449
case SyntaxKind . VariableStatement :
0 commit comments