tobyS / pdv

PHP Documentor for VIM - Generates PHP docblocks
161 stars 32 forks source link

Half broken output #32

Open k1sul1 opened 7 years ago

k1sul1 commented 7 years ago

Consider the following function:

function get_acf_option($option = '', $location = 'options', $format = true) {

When I use pdv#DocumentCurrentLine() on it, I get the following output:

/**
 * ${1:get_acf_option}
 *
 * @param ${2:string} $option${3}
 * @param ${4:string} $location${5}
 * @param ${6:mixed} $format${7}
 */
function get_acf_option($option = '', $location = 'options', $format = true) {

I'm using Vundle to manage my plugins, and I've installed both vmustache & pdv:

let g:pdv_template_dir = $HOME ."/.vim/bundle/pdv/templates_snip"

Plugin 'tobyS/vmustache'
Plugin 'tobyS/pdv'

map <F6> :call pdv#DocumentCurrentLine()<CR>

While the current output is definitely better than manually typing all that, I have to quite a bit of cleanup afterwards. Am I doing something wrong perhaps?

kevinquinnyo commented 6 years ago

I know this is an old issue, but to avoid this, the problem is that you are probably using templates_snip instead of templates. The templates_snip templates are vmustache templated for use with UltiSnips.

The readme is not super clear on this so it took me a while to figure out as well. I'm sure you found the solution or a workaround by now but this is just for anyone else's benefit who ends up here.

k1sul1 commented 6 years ago

Yeah, I did eventually end up using UltiSnips. I just had some problems with it when I first started using Vim, so I did't want to use it at first, and this issue was born.