scalameta / coc-metals

Deprecated in favor of scalameta/nvim-metals
http://scalameta.org/metals/
Apache License 2.0
167 stars 24 forks source link

coc#util#has_preview was removed causing an exception #421

Closed octavz closed 3 years ago

octavz commented 3 years ago

Hey, I keep getting this

UnhandledRejection: request error nvim_call_function - Vim:E117: Unknown function: coc#util#has_preview

It seems coc#util#has_preview was removed in this commit:

https://github.com/neoclide/coc.nvim/commit/00ed6677383e56d79cb2812bfe954f424bb15ded#diff-600a800688b494cf9156b1d447016c253461ad3e3553ae6b9e52b31453e792deL22

octavz commented 3 years ago

locally i replaced it with coc#list#has_preview but I don't think is doing the same thing :).

ckipp01 commented 3 years ago

Thanks for the report @octavz! It looks like we use this in a couple places to check if a preview window is showing or not when we are reloading the doctor. It should be an easy fix. It doesn't look like they actually replace it with anything, but just straight up remove it. So we'll have to see if there is a built-in way to do this or just copy the functionality that was removed and replace our usages with our own function.

We use it in these two places:

https://github.com/scalameta/coc-metals/blob/742a561d639a43ddcf8d0d27d857d41938230cf3/src/index.ts#L411 https://github.com/scalameta/coc-metals/blob/d52c8be0dfe35fd22a7d8189a6be2308ad0e9527/src/commands.ts#L24