Skip to content

Parameter property extensions #726

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

Closed
tmcw opened this issue Apr 13, 2017 · 1 comment
Closed

Parameter property extensions #726

tmcw opened this issue Apr 13, 2017 · 1 comment

Comments

@tmcw
Copy link
Member

tmcw commented Apr 13, 2017

Documenting the elements of a destructured array argument

/** destructuring array */
function destructure([a: number, b: string]) {
}

Should result in something like

- $0[0] (number)
- $0[1] (string)

I think. It does not appear that JSDoc supports this style.

Questions:

  • What to do about the names of the destructured results, like a and b here? When we're dealing with object destructuring, the names are ones that you provide, but here they aren't sensical, since arrays only have indexes. My first guess is to simply discard them.
@tmcw
Copy link
Member Author

tmcw commented Apr 22, 2017

This was fixed in #732, yay! The answer is

- $0.0 (number)
- $0.1 (string)

No new syntax, and it's already supported in the JSDoc spec (and will hopefully be supported in doctrine master)..

The destructured param names don't matter the same way that destructuring-renaming, like function a({ b: c }) doesn't document c.

@tmcw tmcw closed this as completed Apr 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant