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

JSDoc generation - generate @returns when function returns a value #14248

Closed
mjbvz opened this issue Feb 22, 2017 · 6 comments · Fixed by #42068
Closed

JSDoc generation - generate @returns when function returns a value #14248

mjbvz opened this issue Feb 22, 2017 · 6 comments · Fixed by #42068
Assignees
Labels
Committed The team has roadmapped this issue Domain: JSDoc Relates to JSDoc parsing and type generation Fix Available A PR has been opened for this issue Suggestion An idea for TypeScript VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Feb 22, 2017

From @egamma on February 22, 2017 11:14

In the following generated JS Doc comment I would have expected that there is also a @returns comment.

/**
 * 
 * @param {any} a
 * @param {any} b
 */
function foo(a, b) {
  return 12;
}

Copied from original issue: microsoft/vscode#21109

@dtromans
Copy link

This was actually supported at one point and disappeared after an update earlier this year. :(

@David-Else
Copy link

I would also like to see a @returns!

@PhoneixS
Copy link

PhoneixS commented Mar 12, 2018

@mhegazy what feedback are you expecting?

This is something it should do the same way it does with @param. I think there is no need for the tag "Awaiting More Feedback".

The actual issue tracking this is microsoft/vscode#21832

@mhegazy
Copy link
Contributor

mhegazy commented Mar 29, 2018

what feedback are you expecting?

users saying they want to see this implemented. we did not add it to allow return type to be inferred from parameters. this makes updating the function simpler, since updating the function implementation will take effect instead of having to also update the return type.

@Kamadake
Copy link

recently just had a discussion about this with a colleague of mine where he noticed @returns wasn't being outputted automatically when he types /** inside his .ts files.

this should be adjustable in the setting.json. If a user wants it or it's mandatory for a project, let it be configureable by the editor if said team works with VSCode.

@mpf82
Copy link

mpf82 commented Jun 17, 2019

Any progress on this issues?

@mjbvz mjbvz added the VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone label Jul 29, 2020
@RyanCavanaugh RyanCavanaugh added Committed The team has roadmapped this issue and removed Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature labels Dec 9, 2020
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.2.0 milestone Dec 9, 2020
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Dec 21, 2020
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 Domain: JSDoc Relates to JSDoc parsing and type generation Fix Available A PR has been opened for this issue Suggestion An idea for TypeScript VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants