Better comment emit on tokens #17689
Labels
Domain: Comment Emit
The issue relates to the emission of comments when compiling
Meta-Issue
An issue about the team, or the direction of TypeScript
Carrying on from the work initiated in #17557, we should improve our retention of comments where possible. We should check that we retain comments inside:
BinaryExpression
([Master] fix 12985 emit leading and trailing comment around binary operator #16584)ReturnStatement
(Retain comments inside return statements #17557)YieldExpression
(Much better comment preservation #22141)AwaitExpression
(Much better comment preservation #22141)DeleteExpression
(Much better comment preservation #22141)TypeOfExpression
(Much better comment preservation #22141)VoidExpression
(Much better comment preservation #22141)NewExpression
(Much better comment preservation #22141)ElementAccessExpression
(Much better comment preservation #22141)PropertyAccessExpression
(Much better comment preservation #22141)IfStatement
(Much better comment preservation #22141)WhileStatement
(Much better comment preservation #22141)DoStatement
(Much better comment preservation #22141)ForStatement
(Much better comment preservation #22141)ForInStatement
(Much better comment preservation #22141)ForOfStatement
(Much better comment preservation #22141)SwitchStatement
(Much better comment preservation #22141)WithStatement
(Much better comment preservation #22141)ContinueStatement
(Much better comment preservation #22141)BreakStatement
(Much better comment preservation #22141)CaseStatement
(Much better comment preservation #22141)ThrowStatement
(Much better comment preservation #22141) (future:ThrowExpression
)TryStatement
(see Emit comment on catch clause #11755)VariableDeclaration
(Much better comment preservation #22141)AsExpression
(only visible for ts -> ts transforms)TypeAssertionExpression
(same as above)JSXExpression
(in all jsx emit modes) (Comments within JSX Expressions are not preserved #41754)TypePredicateNode
TypeQueryNode
ConstructorTypeNode
FunctionTypeNode
ConditionalTypeNode
InferTypeNode
ThisTypeNode
MappedTypeNode
IndexedAccessTypeNode
More? I welcome examples of places where we do not preserve comments on tokens in the middle of nodes, as that is the general vein of comment preservation we're looking at with these.
The text was updated successfully, but these errors were encountered: