mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(44477): emit full path to access expressions in comments (#44545)
Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
This commit is contained in:
co-authored by
Wesley Wigham
parent
4abad556be
commit
5f9f9e3752
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user