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

Add setting to disable @return generation for JS Doc comments #42637

Closed
mjbvz opened this issue Feb 4, 2021 · 4 comments Β· Fixed by #42642
Closed

Add setting to disable @return generation for JS Doc comments #42637

mjbvz opened this issue Feb 4, 2021 · 4 comments Β· Fixed by #42642
Labels
Committed The team has roadmapped this issue Suggestion An idea for TypeScript

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Feb 4, 2021

Suggestion

πŸ” Search Terms

  • JSDoc / jsdocs

⭐ Suggestion

Add setting to disable the new @return generation for JS Doc comments

This feature was originally added in #14248

πŸ“ƒ Motivating Example

I worry that some users may not like the change that adds @returns automatically

We can enable this new feature by default, but should have an easy way to turn it off.

πŸ’» Use Cases

@mjbvz
Copy link
Contributor Author

mjbvz commented Feb 4, 2021

My proposal would be to add a new parameter to the docCommentTemplate request that determines if returns are generated or not:

    interface DocCommentTemplateRequest extends FileLocationRequest {
        command: CommandTypes.DocCommentTemplate;
        arguments: DocCommentTemplateRequestArgs;
    }

    interface DocCommentTemplateRequestArgs extends FileLocationRequestArgs {
        generateReturn?: boolean; // new field
    }

/cc @RyanCavanaugh Since I think we should address this before the 4.2 RC

@a-tarasyuk
Copy link
Contributor

a-tarasyuk commented Feb 4, 2021

Since I think we should address this before the 4.2 RC

Based on the Iteration Plan, RC will be created tomorrow. So, I've created a Draft PR to resolve this issue.

/cc @mjbvz

@RyanCavanaugh
Copy link
Member

@mjbvz RC is very soon and this feels like a feature, can we add configurability in 4.3?

@RyanCavanaugh RyanCavanaugh added Committed The team has roadmapped this issue Suggestion An idea for TypeScript labels Feb 5, 2021
@mjbvz
Copy link
Contributor Author

mjbvz commented Feb 5, 2021

This is a new feature in 4.2, so I'm concerned we're going to get complaints about the change in behavior once this feature goes out. Having a setting to disable the new behavior would be helpful if people do not like the new behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Committed The team has roadmapped this issue Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants