@@ -240,6 +240,8 @@ namespace ts.OutliningElementsCollector {
240
240
return spanForArrowFunction ( n as ArrowFunction ) ;
241
241
case SyntaxKind . CallExpression :
242
242
return spanForCallExpression ( n as CallExpression ) ;
243
+ case SyntaxKind . ParenthesizedExpression :
244
+ return spanForParenthesizedExpression ( n as ParenthesizedExpression ) ;
243
245
}
244
246
245
247
function spanForCallExpression ( node : CallExpression ) : OutliningSpan | undefined {
@@ -256,7 +258,7 @@ namespace ts.OutliningElementsCollector {
256
258
}
257
259
258
260
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 ) ) {
260
262
return undefined ;
261
263
}
262
264
const textSpan = createTextSpanFromBounds ( node . body . getFullStart ( ) , node . body . getEnd ( ) ) ;
@@ -307,6 +309,12 @@ namespace ts.OutliningElementsCollector {
307
309
function spanForNodeArray ( nodeArray : NodeArray < Node > ) : OutliningSpan | undefined {
308
310
return nodeArray . length ? createOutliningSpan ( createTextSpanFromRange ( nodeArray ) , OutliningSpanKind . Code ) : undefined ;
309
311
}
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
+ }
310
318
}
311
319
312
320
function functionSpan ( node : SignatureDeclaration , body : Block , sourceFile : SourceFile ) : OutliningSpan | undefined {
0 commit comments