Skip to content
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

do not merge jsdoc tags with the same name with flag --noTagMerge #932

Closed
wants to merge 2 commits into from

Conversation

Feiyang1
Copy link

@Feiyang1 Feiyang1 commented Oct 26, 2018

Currently JSDoc tags with the same names are merged in the output externs.
For example,

/**
 *  @example
 *   example 1
 *  @example
 *   example 2
*/
function test() {}

becomes

/**
 * \@example
 *   example 1 /
 *   example 2
 * @return {void}
 */
function test() { }

Notice that @example tags are merged.

This PR adds a new flag --noTagMerge. If set to true, JSDoc tags with the same name will not be merged. This is to address an issue I opened earlier: #907
With this change, and command tsickle --noTagMerge --externs=output.js
the output will look like:

/**
 * \@example 
 *   example 1
 * \@example 
 *   example 2
 * @return {void}
 */
function test() {}

I wanted to add a test case, but I couldn't find any place for module_type_translator.ts. Please let me know how I can do it properly, and I will add the test case.

@mprobst
Copy link
Contributor

mprobst commented Oct 26, 2018 via email

@Feiyang1
Copy link
Author

I added a test case in test/tsickle_test.ts. Is it the right place ?
I also tried to add a test file under test_files, but it always creates a js file without using the flag.
How do I tell the test suite to compile the new file with the flag I added?

@Feiyang1 Feiyang1 force-pushed the noTagMerge branch 2 times, most recently from da43fb7 to 0e22a37 Compare October 30, 2018 00:09
@mprobst
Copy link
Contributor

mprobst commented Oct 30, 2018 via email

@evmar
Copy link
Contributor

evmar commented Oct 30, 2018

You cannot control this by a flag, because some tags must be merged, such as @return. We should instead control this in tsickle -- there's no good reason for tsickle to ever merge @example tags, so we should be able to construct a whitelist of tags that should or shouldn't be merged.

@evmar
Copy link
Contributor

evmar commented Nov 12, 2018

Should I close this? Or do you intend to follow up on it?

@Feiyang1
Copy link
Author

Please close it. I agree it is the wrong direction to go.

@Feiyang1 Feiyang1 closed this Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants