jeremyvii / vs-docblockr

DocBlockr for Visual Studio Code
GNU Lesser General Public License v3.0
21 stars 8 forks source link

JavaScript object destructuring in function #52

Closed MaffooBristol closed 4 years ago

MaffooBristol commented 4 years ago

Describe the bug In modern JS you can do function foo({ a, b }) {} rather than function foo(args) { args.a }

However, this extension gets a bit confused and thinks that the braces are arguments.

Code Snippet

function AuthChecker({ dispatch, authed, session }) {
}

Output

/**
 * [AuthChecker description]
 *
 * @param {[type]} {
 *   [{ description]
 * @param {[type]} dispatch
 *   [dispatch description]
 * @param {[type]} authed
 *   [authed description]
 * @param {[type]} session
 *   [session description]
 * @param {[type]} }
 *   [ description]}
 *
 * @return {[type]}
 *   [return description]
 */

Expected

/**
 * [AuthChecker description]
 *
 * @param {[type]} dispatch
 *   [dispatch description]
 * @param {[type]} authed
 *   [authed description]
 * @param {[type]} session
 *   [session description]
 *
 * @return {[type]}
 *   [return description]
 */

Environment (please complete the following information):

jeremyvii commented 4 years ago

This will be fixed in the next release.