You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native printer panics when printing JSDoc AST nodes (emitJSDocNode not implemented) #65429
This is the behavior in every version I tried, and I reviewed the FAQ for entries about this. It reproduces on current main of the native (Go) compiler: Printer.emitJSDocNode is still a stub.
⏯ Playground Link
N/A. This is about the native Go printer and the TypeScript 7 JS API (api.printer.printNode), which the Playground does not exercise.
💻 Code
varfactory ast.NodeFactorydoc:=factory.NewJSDoc(
factory.NewNodeList([]*ast.Node{factory.NewJSDocText([]string{"This is a function description"})}),
nil, /*tags*/
)
printer.NewPrinter(
printer.PrinterOptions{NewLine: core.NewLineKindLF},
printer.PrintHandlers{},
nil,
).Emit(doc, nil) // panics: not implemented
The same panic is reachable from the JS API via api.printer.printNode(jsdocNode).
🙁 Actual behavior
The printer dispatches JSDoc node kinds to Printer.emitJSDocNode in tsc/internal/printer/printer.go, which is currently:
The printer should emit a formatted JSDoc comment, including its text and tags, like it does for other node kinds.
Additional information about the issue
I searched open and closed issues and PRs for this and found no other report or PR that implements JSDoc node emission. Open PR #64500 (synthetic comments and emit flags in the API) is related but does not implement emitJSDocNode.
This replaces #65057, which was closed because I did not use the issue template. Sorry about that, and thanks for pointing it out. A focused fix PR will be linked here.
Fix is up in #65430. Related context: #64429 / #64500 (synthetic comments and emit flags in the API) and #17146 (transforming and emitting JSDoc comments).
Activity
el-j commentedon Nov 10, 2026
Fix is up in #65430. Related context: #64429 / #64500 (synthetic comments and emit flags in the API) and #17146 (transforming and emitting JSDoc comments).