diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index d9d6fb6640a..3048d1a5e33 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -198,6 +198,10 @@ namespace ts.OutliningElementsCollector { } function spanForJSXAttributes(node: JsxAttributes): OutliningSpan | undefined { + if (node.properties.length === 0) { + return undefined; + } + return createOutliningSpanFromBounds(node.getStart(), node.getEnd(), OutliningSpanKind.Code); }