Copyright comments are not preserved when generating d.ts files#5472
Conversation
There was a problem hiding this comment.
There is already an isPinnedComments elsewhere. Also, can you rename it to isPinnedComment?
There was a problem hiding this comment.
isPinnedComments function was in emitter.ts and I put it inside emitDetachedComments because it is not used anywhere else.
Yes, I can rename it.
|
unit tests? |
There was a problem hiding this comment.
I think it will be better to not pass in the detachedCommentsInfo array into the function and return currentDetachedCommentInfo and then have a function in emitter call emitDetachedCommentsAndUpdateCommentsInfo that calls into this function and do the following logic
if (detachedCommentsInfo) {
detachedCommentsInfo.push(currentDetachedCommentInfo);
}
else {
detachedCommentsInfo = [currentDetachedCommentInfo];
}So that in the case of using the function in declarationEmitter.ts, we will not be doing throw away work.
There was a problem hiding this comment.
also please add return type. And return type and parameter type into JSDoc
There was a problem hiding this comment.
also please add return type. And return type and parameter type into JSDoc
I'm not sure how to do that becase I see no other @return or @param in utilities.ts. Can you elaborate?
|
@mhegazy Yes, I added some. |
|
Thanks for fast iteration. Can you add one more case with similar content but with |
|
@yuit Sure |
|
lgtm. @MartyIX thanks for the PR 🍪 |
Fix copyright comments are not preserved when generating d.ts files
This is a proposed fix for #5183 ... WIP