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
if(Node.isPropertyAssignment(node)){constjsDoc=node.getJsDocs().map((doc)=>doc.getCommentText()).join('\n');// throw error about type "PropertyAssignment" don't have method "getJsDocs"。}
I don't know it's a feature or bug?
The text was updated successfully, but these errors were encountered:
constcode=`/** * This is test */export const test = { /** * This is a */ a: 1, /** * This is b */ b: 2,};`;constproject=newProject();constsourceFile=project.createSourceFile("",code);sourceFile.forEachDescendant((node)=>{if(Node.isVariableStatement(node)){constdocs=node.getJsDocs();for(constdocofdocs){console.log(doc.getCommentText());}}});
I could find JSDoc node from ast. But when I can't get it by getJsDoc.
https://ts-ast-viewer.com/#code/PQKhCgAIUgVALAlgZ0iyAXApsjUTDhYAeADgPYBOGkAxuQHa6Y40C8kA3lJL6BL0EwE6dAEMeQwoMhiAXJACMAGkmR+a6HCSp0AI00E1ehQCZVAXwDc4IA
I don't know it's a feature or bug?
The text was updated successfully, but these errors were encountered: