fix(46666): add outlining spans for comments preceding call expressions (#46682)

This commit is contained in:
Oleksandr T 2021-11-04 21:43:01 +02:00 committed by GitHub
parent ae582a22ee
commit 4fca1e1fcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -34,7 +34,7 @@ namespace ts.OutliningElementsCollector {
if (depthRemaining === 0) return;
cancellationToken.throwIfCancellationRequested();
if (isDeclaration(n) || isVariableStatement(n) || isReturnStatement(n) || n.kind === SyntaxKind.EndOfFileToken) {
if (isDeclaration(n) || isVariableStatement(n) || isReturnStatement(n) || isCallOrNewExpression(n) || n.kind === SyntaxKind.EndOfFileToken) {
addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out);
}

View file

@ -192,6 +192,13 @@
//// */|]
//// const x = 1;
////}|]
////
////[|/*
////comment
////*/|]
////
////f6();
////
////class C1[| {
//// [|/**
//// * comment
@ -231,6 +238,12 @@
//// */|]
//// private prop = 1;
////}|]
////
////[|/*
////comment
////*/|]
////new C4();
////
////module M1[| {
//// [|/**
//// * comment