Typescript: JSDoc generation - generate @returns when function returns a value

Created on 22 Feb 2017  路  6Comments  路  Source: microsoft/TypeScript

_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_

Awaiting More Feedback JSDoc Suggestion VS Code Priority VS Code Tracked

Most helpful comment

Any progress on this issues?

All 6 comments

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

I would also like to see a @returns!

@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 https://github.com/Microsoft/vscode/issues/21832

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.

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.

Any progress on this issues?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartynasZilinskas picture MartynasZilinskas  路  3Comments

blendsdk picture blendsdk  路  3Comments

siddjain picture siddjain  路  3Comments

weswigham picture weswigham  路  3Comments

Antony-Jones picture Antony-Jones  路  3Comments