tcomment_vim icon indicating copy to clipboard operation
tcomment_vim copied to clipboard

PHP comment characters don't work

Open yoshida-m-3 opened this issue 3 years ago • 3 comments

I want you to comment out with #, but it becomes <!-->.

I set it as follows, but the result does not change. What should I do?

  if !exists('g:tcomment_types')
    let g:tcomment_types = {}
  endif
  let g:tcomment_types['php'] = '// %s'
<?php

class Test
{
    public $aaa;
}

press gcc

<?php

class Test
{
    <!-- public $aaa; -->
}

yoshida-m-3 avatar Sep 09 '21 07:09 yoshida-m-3

Please see :h tcomment-debug and post the output here.

The problem seems to be that tcomment thinks this is HTML and not PHP. Do you use the default php plugin?

tomtom avatar Sep 09 '21 10:09 tomtom

Debug output result

TCOMMENT: &ft = php => php
TCOMMENT: stx =  =>
TCOMMENT: ct  = {'_args': {'beg': 31, 'fallbackFiletype': '', 'end': 31, 'filetype': 'php', 'comment_mode': ''}, 'commentstring': '// %s', 'mode': '', 'filetype': 'php'}
The info was also copied to the clipboard @+
Please see also :help tcomment-debug

PHP related plugins include neoclide/coc.nvim and marlonfan/coc-phpls language servers.

However, once I tried removing the plugin, the comment didn't work

This is my plugin list https://github.com/yoshida-m-3/nvim/blob/main/dein.toml

yoshida-m-3 avatar Sep 09 '21 23:09 yoshida-m-3

I have the same issue.

skylite21 avatar Dec 24 '22 00:12 skylite21