heavenshell / vim-jsdoc

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

Return Type Includes Arrorw with Flow and Arrow Functions #77

Closed DeedleFake closed 4 years ago

DeedleFake commented 6 years ago

Running :JsDoc on

const example = (key: string, val: string): string => {
  return val
}

produces the comment

/**
 * example
 *
 * @param {string} key
 * @param {string)} val
 * @returns {string =>}
 */
heavenshell commented 6 years ago

Thx for reporting. Known issue and it's hard to fix.

Please stay tuned.

P.S. PR are very welcome.

malakada commented 4 years ago

Extra: in this example:

const Container = ({ message: string }): JSX.Element => (
  <div>{message}</div>
);

Running :JsDoc would generate this:

/**
 * Container
 *
 * @param {string})} {message
 * @returns {JSX.Element => (}
 */

A more desirable output would be:

/**
 * Container
 *
 * @param {string} message
 * @returns {JSX.Element}
 */
heavenshell commented 4 years ago

@malakada Thx. Yes, currently jsdoc.vim does not works perfectly. But Now I'm planning to rewrite jsdoc.vim complety new(ver 2).

ver2 will be able to parse complex types.

heavenshell commented 4 years ago

2.0.0 was released