fix(44477): emit full path to access expressions in comments (#44545)

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
This commit is contained in:
Oleksandr T
2022-03-04 11:22:46 -08:00
committed by GitHub
co-authored by Wesley Wigham
parent 4abad556be
commit 5f9f9e3752
40 changed files with 253 additions and 257 deletions
+1 -5
View File
@@ -3368,13 +3368,9 @@ namespace ts {
const substitute = typeof constantValue === "string" ? factory.createStringLiteral(constantValue) : factory.createNumericLiteral(constantValue);
if (!compilerOptions.removeComments) {
const originalNode = getOriginalNode(node, isAccessExpression);
const propertyName = isPropertyAccessExpression(originalNode)
? declarationNameToString(originalNode.name)
: safeMultiLineComment(getTextOfNode(originalNode.argumentExpression));
addSyntheticTrailingComment(substitute, SyntaxKind.MultiLineCommentTrivia, ` ${propertyName} `);
addSyntheticTrailingComment(substitute, SyntaxKind.MultiLineCommentTrivia, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
}
return substitute;
}