fix(56665): Improve Outline for template literals (#56667)

This commit is contained in:
Oleksandr T
2023-12-15 19:04:07 +02:00
committed by GitHub
parent 2c7162143b
commit 22bee05d8f
3 changed files with 100 additions and 6 deletions

View File

@@ -84,6 +84,7 @@ import {
isStatic,
isStringLiteralLike,
isStringOrNumericLiteralLike,
isTemplateLiteral,
isToken,
isVariableDeclaration,
lastOrUndefined,
@@ -1057,7 +1058,7 @@ function getFunctionOrClassName(node: FunctionExpression | FunctionDeclaration |
return `${name} callback`;
}
const args = cleanText(mapDefined(parent.arguments, a => isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined).join(", "));
const args = cleanText(mapDefined(parent.arguments, a => isStringLiteralLike(a) || isTemplateLiteral(a) ? a.getText(curSourceFile) : undefined).join(", "));
return `${name}(${args}) callback`;
}
}