mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Fixed outlining spans for chained method calls. (#35860)
This commit is contained in:
committed by
Daniel Rosenwasser
parent
4942fd2b84
commit
82b0547281
@@ -45,7 +45,14 @@ namespace ts.OutliningElementsCollector {
|
||||
if (span) out.push(span);
|
||||
|
||||
depthRemaining--;
|
||||
if (isIfStatement(n) && n.elseStatement && isIfStatement(n.elseStatement)) {
|
||||
if (isCallExpression(n)) {
|
||||
depthRemaining++;
|
||||
visitNonImportNode(n.expression);
|
||||
depthRemaining--;
|
||||
n.arguments.forEach(visitNonImportNode);
|
||||
n.typeArguments?.forEach(visitNonImportNode);
|
||||
}
|
||||
else if (isIfStatement(n) && n.elseStatement && isIfStatement(n.elseStatement)) {
|
||||
// Consider an 'else if' to be on the same depth as the 'if'.
|
||||
visitNonImportNode(n.expression);
|
||||
visitNonImportNode(n.thenStatement);
|
||||
|
||||
Reference in New Issue
Block a user