Add capability of transforming and emitting JSDoc comments
See original GitHub issueSo I am trying to create a new documentation generator for TypeScript together with @BurtHarris. Currently it does not do much; I’ve been mainly tinkering a bit with the compiler API to see what it is capable of. You will be able to find it here when it’s finished.
One of the things we thought about was the ability to ‘target’ JSDoc comments using the type information provided by TypeScript. I’ve been investigating how to tackle the issue. Ideally, it would use the transformers the compiler API has to offer but of all the functions provided in factory.ts
, the ones that came closest were addSyntheticLeadingComment
, setSyntheticLeadingComments
, setSyntheticTrailingComments
and addSyntheticTrailingComment
; none of which provide the means to create complete synthetic JSDoc tags and comments.
So with this issue I’m actually asking the status-quo of this feature. Is it still possible to get this on the roadmap? If so, can I help? If not, is there a possibility of a patch that makes it possible to implement this as a third-party module?
Related issues
- Generate doc comments in emitted JS
- Cannot add or modify JSDoc with custom transformers
- Expose public API for transformation
- Replace emitter with syntax tree transformations and a simplified node emitter
Previous attempts
Issue Analytics
- State:
- Created 6 years ago
- Reactions:19
- Comments:13 (4 by maintainers)
Top GitHub Comments
Hmm sorry but it is no longer exists anymore. So how can I transform a JSDoc comment now?
it’s possible to emit jsdoc nodes using
ts.factory.createJSDocComment
, example:https://gist.github.com/alanhoff/b1a2ed871cf7046ca1f2f3c9e0bae1aa