fannheyward / create-coc-extension

Create a coc extension from command line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

triggerPattern not working anymore

sgelb opened this issue · comments

commented

Hello,

since neoclide/coc.nvim@0ff4c24, using triggerPattern in a created extension does not work anymore.

To reproduce

  • run create-coc-extension test
  • change the empty triggerPattern in test/src/index.ts to triggerPatterns: [/Test/]
  • add enable: true
  • add set runtimepath^=/path/to/test to init.vim
  • run yarn build

Before neoclide/coc.nvim@0ff4c24, after typing Test I could complete to TestCompletionItem 1 and TestCompletionItem 2. After that commit, nothing happens.

Is this a problem of create-coc-extension or of coc.nvim?

If you defined triggerPatterns, coc will consider this source is triggerOnly, https://github.com/neoclide/coc.nvim/blob/d3048fd4badd3fdf9eb34153bcac29a4a5900123/src/model/source.ts#L36.

Test with this: coc#refresh() to refresh completion without input Test, this source will available.

commented

Hello,

perhaps I did not describe my problem thorough enough. After typing Test, it would automatically provide an popup with the suitable completions. After the commit, this does not happen anymore, coc#refresh() does not change anything. It looks exactly like the problem described in neoclide/coc.nvim#2032. There, you mentioned a "triggerPatterns regex issue".

I will experiment a bit more.

You can get completion suggestions after you type Test..