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
/** Get JSDoc for a node or create one if there isn't any */functiongetJsDocOrCreate(node: JSDocableNode): JSDoc{returnnode.getJsDocs()[0]||node.addJsDoc({});}
/** * Inserts a text range into a parent. */exportfunctioninsertIntoParentTextRange(opts: InsertIntoParentTextRangeOptions){const{ insertPos, newText, parent }=opts;doManipulation(parent._sourceFile,newInsertionTextManipulator({
insertPos,
newText,replacingLength: opts.replacing?.textLength,}),newNodeHandlerFactory().getForParentRange({
parent,start: insertPos,end: insertPos+newText.length,replacingLength: opts.replacing?.textLength,replacingNodes: opts.replacing?.nodes,customMappings: opts.customMappings,}),);}
ts-to-jsdoc uses ts-morph for code manipulations in typescript files
for example, ts-to-jsdoc adds jsdoc nodes:
addJsDoc calls insertIntoParentTextRange
insertIntoParentTextRange calls InsertionTextManipulator
... but the code manipulation is not recorded in a sourcemap
i am passing the option
{ sourceMap: true }
to the typescript compilerbut this option is not used by ts-morph
expected behavior: similar to https://github.com/Rich-Harris/magic-string
related downstream issue: futurGH/ts-to-jsdoc#19
The text was updated successfully, but these errors were encountered: