neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.06k stars 68 forks source link

Autocomplete snippet not always expand #399

Closed otavioschwanck closed 2 years ago

otavioschwanck commented 2 years ago

Example with typescript and Bootstrap-react (Button tag):

Its seems that is randomly expands.

Or maybe only when i go down a (when its in 3rd item), this way it expand most of times. Kapture 2022-09-04 at 20 18 35

Infos: https://pasteio.com/xjxMp6rXQqzf https://pasteio.com/xbDke1p52DWQ

about the infos: executed two times, one worked, one not

chemzqm commented 2 years ago

Maybe you have triggered coc#pum#insert which not insert snippet, or something else happened.

otavioschwanck commented 2 years ago

@chemzqm i used: inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\"

chemzqm commented 2 years ago

Try minimal vimrc

otavioschwanck commented 2 years ago

@chemzqm

Try minimal vimrc

my imap CR: i & EunuchNewLine(coc#pum#visible() ? coc#pum#confirm(): "\u\\=coc#on_enter()\")

Removed eunuch and same problem happens:


i  <CR>        * coc#pum#visible() ? coc#pum#confirm(): "\<C-G>u\<CR>\<C-R>=coc#on_enter()\<CR>"```

Only using CoC
otavioschwanck commented 2 years ago

@chemzqm one important detail:

the onClick, when dont complete the snippet, it adds the = (part or snippet)

the result is:

onClick=

And when expand all snippets it gets:

onClick={}
chemzqm commented 2 years ago

Always expand as expected for me, try latest tsserver by configure tsserver.sdk

otavioschwanck commented 2 years ago

Always expand as expected for me, try latest tsserver by configure tsserver.sdk

how can i do that?

otavioschwanck commented 2 years ago

Ignoring the local tsserver fixes the problem