-
Notifications
You must be signed in to change notification settings - Fork 16
Some fixes #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some fixes #6
Conversation
cfc653b
to
b11251c
Compare
Thanks for the contribution! This looks great for the most part; frankly more effort than I put into what was really just a throwaway script I decided to publish. |
index.ts
Outdated
/** | ||
* Generate @returns documentation from function return type | ||
* the new jsDoc is stored in functionNode | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | |
* Generate @returns documentation from function return type | |
* the new jsDoc is stored in functionNode | |
*/ | |
/** Generate @returns documentation from function return type and attach it to functionNode */ |
Good idea to include this info, though it doesn't need to be on a separate line. Same goes for the other instances where this line was added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh come on .... ^^
index.ts
Outdated
`internal error: protectCommentsHeader is missing in output\n\n` + | ||
`protectCommentsHeader: ${JSON.stringify(protectCommentsHeader)}\n` + | ||
`result: ${JSON.stringify(result.slice(protectCommentsHeader.length + 100) + " ...")}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`internal error: protectCommentsHeader is missing in output\n\n` + | |
`protectCommentsHeader: ${JSON.stringify(protectCommentsHeader)}\n` + | |
`result: ${JSON.stringify(result.slice(protectCommentsHeader.length + 100) + " ...")}` | |
`Internal error: generated header is missing in output\n\n` + | |
`protectCommentsHeader: ${JSON.stringify(protectCommentsHeader)}\n` + | |
`result: ${JSON.stringify(result.slice(protectCommentsHeader.length + 100) + " ...")}` |
Likely less confusing to avoid mentioning the variable name in the error message; why does the header need to be JSON.stringif
[ied]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helpful for debugging, when ts-morph/typescript returns an unexpected value
we want to remove exactly what we added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was referring to JSON.stringify(protectCommentsHeader)
. Since it's a defined constant variable where we know its content, in what scenario would the JSON.stringify
call produce a more desirable output than just including the variable without the wrapping function call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exact diff
yeah ... i wanted to throw this at but ultimately, the typescript syntax is better, and compiling is fast enough i also tried to patch ts-morph to make every TypedNode also a JSDocableNode |
Ah, I wasn't sure if the lack of |
can we haz merge? im not planning to do much more on this, as i dont need ts-to-jsdoc for now |
Sorry! I haven't had the time to take a look at this PR on my own machine yet — I think we can do without the tests for now considering that there still appears to be some work to be done there and I don't have the time to work on tests much myself. I'll try and merge in the rest soon. |
thanks! : ) |
fix #5
maybe fix #4