fix(46666): add outlining spans for comments preceding call expressions (#46682)
This commit is contained in:
parent
ae582a22ee
commit
4fca1e1fcd
|
@ -34,7 +34,7 @@ namespace ts.OutliningElementsCollector {
|
||||||
if (depthRemaining === 0) return;
|
if (depthRemaining === 0) return;
|
||||||
cancellationToken.throwIfCancellationRequested();
|
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);
|
addOutliningForLeadingCommentsForNode(n, sourceFile, cancellationToken, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,6 +192,13 @@
|
||||||
//// */|]
|
//// */|]
|
||||||
//// const x = 1;
|
//// const x = 1;
|
||||||
////}|]
|
////}|]
|
||||||
|
////
|
||||||
|
////[|/*
|
||||||
|
////comment
|
||||||
|
////*/|]
|
||||||
|
////
|
||||||
|
////f6();
|
||||||
|
////
|
||||||
////class C1[| {
|
////class C1[| {
|
||||||
//// [|/**
|
//// [|/**
|
||||||
//// * comment
|
//// * comment
|
||||||
|
@ -231,6 +238,12 @@
|
||||||
//// */|]
|
//// */|]
|
||||||
//// private prop = 1;
|
//// private prop = 1;
|
||||||
////}|]
|
////}|]
|
||||||
|
////
|
||||||
|
////[|/*
|
||||||
|
////comment
|
||||||
|
////*/|]
|
||||||
|
////new C4();
|
||||||
|
////
|
||||||
////module M1[| {
|
////module M1[| {
|
||||||
//// [|/**
|
//// [|/**
|
||||||
//// * comment
|
//// * comment
|
||||||
|
|
Loading…
Reference in a new issue