Skip to content

Conversation

@nknapp
Copy link

@nknapp nknapp commented Mar 21, 2017

This commit adds a property "ctx.params" (an array of strings)
to the parsed comment..

The rationale is that the @param-tags are not necessarily in the same
order as the parameters in the code. In the case of

/**
 * @param {number} a
 * @param {string} b
 */
function myFunction(b,a) {
}

it would otherwise not be possible to create the correct documentation
(that shows the correct order of the parameter)

This commit adds a property "ctx.params" (an array of strings)
to the parsed comment..

The rationale is that the @param-tags are not necessarily in the same
order as the parameters in the code. In the case of

/**
 * @param {number} a
 * @param {string} b
 */
function myFunction(b,a) {
}

it would otherwise not be possible to create the correct documentation
(that shows the correct order of the parameter)
@nknapp
Copy link
Author

nknapp commented Mar 22, 2017

Maybe consider this work-in-progress. I just realized, that there are a couple of cases that would break with this change.

/**
 * @param a
 * @param b
 */
function abc(a, ...b) {} 

/**
 * @param a
 * @param b
 * @param c
 * @param d
 */
function abc(a, {b,c,d}) {}

/**
 * @param a
 */
function abc(a /* , dynamic args */) {}

The question is, do you actually want to support this? Otherwise I would just use my own fork.

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

Successfully merging this pull request may close these issues.

1 participant