@@ -240,6 +240,8 @@ namespace ts.OutliningElementsCollector {
240240 return spanForArrowFunction ( n as ArrowFunction ) ;
241241 case SyntaxKind . CallExpression :
242242 return spanForCallExpression ( n as CallExpression ) ;
243+ case SyntaxKind . ParenthesizedExpression :
244+ return spanForParenthesizedExpression ( n as ParenthesizedExpression ) ;
243245 }
244246
245247 function spanForCallExpression ( node : CallExpression ) : OutliningSpan | undefined {
@@ -256,7 +258,7 @@ namespace ts.OutliningElementsCollector {
256258 }
257259
258260 function spanForArrowFunction ( node : ArrowFunction ) : OutliningSpan | undefined {
259- if ( isBlock ( node . body ) || positionsAreOnSameLine ( node . body . getFullStart ( ) , node . body . getEnd ( ) , sourceFile ) ) {
261+ if ( isBlock ( node . body ) || isParenthesizedExpression ( node . body ) || positionsAreOnSameLine ( node . body . getFullStart ( ) , node . body . getEnd ( ) , sourceFile ) ) {
260262 return undefined ;
261263 }
262264 const textSpan = createTextSpanFromBounds ( node . body . getFullStart ( ) , node . body . getEnd ( ) ) ;
@@ -307,6 +309,12 @@ namespace ts.OutliningElementsCollector {
307309 function spanForNodeArray ( nodeArray : NodeArray < Node > ) : OutliningSpan | undefined {
308310 return nodeArray . length ? createOutliningSpan ( createTextSpanFromRange ( nodeArray ) , OutliningSpanKind . Code ) : undefined ;
309311 }
312+
313+ function spanForParenthesizedExpression ( node : ParenthesizedExpression ) : OutliningSpan | undefined {
314+ if ( positionsAreOnSameLine ( node . getStart ( ) , node . getEnd ( ) , sourceFile ) ) return undefined ;
315+ const textSpan = createTextSpanFromBounds ( node . getStart ( ) , node . getEnd ( ) ) ;
316+ return createOutliningSpan ( textSpan , OutliningSpanKind . Code , createTextSpanFromNode ( node ) ) ;
317+ }
310318 }
311319
312320 function functionSpan ( node : SignatureDeclaration , body : Block , sourceFile : SourceFile ) : OutliningSpan | undefined {
0 commit comments