heavenshell / vim-jsdoc

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

Does vim-jsodc support @typedef ? #40

Closed elrrrrrrr closed 9 years ago

elrrrrrrr commented 9 years ago

How to generator such JSDoc ?

/**
 * @typedef Point
 * @type Object
 * @property {number} x The X Coordinate
 * @property {number} y The Y Coordinate
 */

/**
 * Returns a coordinate from a given mouse or touch event
 * @param  {TouchEvent|MouseEvent|jQuery.Event} e    
 *         A valid mouse or touch event or a jQuery event wrapping such an
 *         event. 
 * @param  {string} [type="page"]
 *         A string representing the type of location that should be
 *         returned. Can be either "page", "client" or "screen".
 * @return {Point} 
 *         The location of the event
 */
var getEventLocation = function(e, type) {
    ...

    return {x: xLocation, y: yLocation};
}
heavenshell commented 9 years ago

Does vim-jsodc support @typedef ?

Nope. JSDoc.vim can only generate from signature.

/**
 * Returns a coordinate from a given mouse or touch event
 * @param  {TouchEvent|MouseEvent|jQuery.Event} e    
 *         A valid mouse or touch event or a jQuery event wrapping such an
 *         event. 
 * @param  {string} [type="page"]
 *         A string representing the type of location that should be
 *         returned. Can be either "page", "client" or "screen".
 * @return {Point} 
 *         The location of the event
 */

Currently, @param {type} description is one line. Maybe we'd better to introduce like templating system, but I don't have any plan. Sorry.

elrrrrrrr commented 9 years ago

THX for replay .