heavenshell / vim-jsdoc

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

Fixes the jsdoc comment format #29

Closed IonicaBizau closed 9 years ago

IonicaBizau commented 9 years ago

Fixes #28. Please check if it's fine. Thanks! :smile:

heavenshell commented 9 years ago

Thx for PR. I'll check it later.

heavenshell commented 9 years ago

@IonicaBizau I've got following result.

/**
 * foo
 *
 * @param {} bar
 * @param {} baz
 * @param  {Function}callback The callback function.
 */
function foo(bar, baz, callback) {
}

At * @param {Function}callback The callback function., @param and {Function} has two spaces and no space between {Function} and callback.

let g:jsdoc_allow_input_prompt = 1
let g:jsdoc_custom_args_hook = {
  \ 'callback\|cb': {
  \   'type': '{Function}',
  \   'description': 'The callback function.'
  \ },
  \ 'progress': {
  \   'type': '{Function}',
  \   'description': 'The progress function.'
  \ }
  \}

Could you fix this?

IonicaBizau commented 9 years ago

@heavenshell Reproduced. Could give me a hint where is this handled?

heavenshell commented 9 years ago

https://github.com/IonicaBizauKitchen/vim-jsdoc/blob/8cb4556534e4a51dcd6ce3152554a94b249ff4d6/autoload/jsdoc.vim#L87

This line. Your PR changes to {type} argname, so you need add space after {type}. Cheers :smile:

IonicaBizau commented 9 years ago

@heavenshell Fixed. :smile: Thanks!

IonicaBizau commented 9 years ago

:tada: My first contribution to a vim plugin! :fireworks:

heavenshell commented 9 years ago

Merged. thx for your contribution! Now you can write Vim script :smile:

ryanoasis commented 9 years ago

@IonicaBizau Awesome. Welcome to the dark side :smiling_imp: :+1:

IonicaBizau commented 9 years ago

@ryanoasis :smile_cat: That was fun! I realize that VIM lang is pretty much intuitive. I have no experience in writing such code, but looking at the other snippets in the file I was kind of easy to fix this. :smile: