heavenshell / vim-jsdoc

Generate JSDoc to your JavaScript code.
BSD 3-Clause "New" or "Revised" License
452 stars 44 forks source link

Does not work with async functions #99

Closed holtc closed 4 years ago

holtc commented 4 years ago

Running :JsDoc on the following function does not work properly.

const doSomething = async (param1, param2, param3) => {} turns into:

/**
 * @type = {}
 */

Instead, I believe it should say the below (like it does without the async):

/**
 * doSomething.
 * @param {} param1
 * @param {} param2
 */
heavenshell commented 4 years ago

@holtc Thx for reporting. This is very annoying behavior. Currently vim-jsdoc can't judge async() {} is method or function(AST can judge but Vim script can't). I'll try to fix this but bit hard.

Just workaround solution, you can do <Shft-v> at const doSomething line and type :'<,'>JsDoc

heavenshell commented 4 years ago

@holtc fixed and release as 2.1.1 Thank you for reporting this!