kevinhwang91 / nvim-ufo

Not UFO in the sky, but an ultra fold in Neovim.
BSD 3-Clause "New" or "Revised" License
2.23k stars 44 forks source link

UnhandledPromiseRejection with the reason: ufo/provider/lsp.lua:61: service not started #46

Closed romgrk closed 2 years ago

romgrk commented 2 years ago

Neovim version (nvim -v | head -n1)

NVIM v0.7.2

Operating system/version

archlinux

How to reproduce the issue

Install Coc & setup ufo with:

local ufo = require('ufo')

ufo.setup({
  open_fold_hl_timeout = 0,
})

vim.keymap.set('n', 'zr', ufo.openAllFolds)
vim.keymap.set('n', 'zm', ufo.closeAllFolds)

Then do some work, and at some point the following message keeps appearing at every 5 seconds (triggered by many actions, such as write file, or cursor movement):

Error executing vim.schedule lua callback: UnhandledPromiseRejection with the reason:                                                                                                                                
...vim/site/pack/packer/start/nvim-ufo/lua/ufo/provider.lua:51: ...site/pack/packer/start/nvim-ufo/lua/ufo/provider/lsp.lua:61: service not started 
...re/nvim/site/pack/packer/start/nvim-ufo/lua/ufo/fold.lua:89: in function <Anonymous:70>

No ufo.log found.

Expected behavior

No error.

Actual behavior

Error.

kevinhwang91 commented 2 years ago

https://github.com/neoclide/coc.nvim/blob/43744ba82bd348ea971b87483a13f06f3e46c94b/plugin/coc.vim#L134

Look like your coc.nvim issue. Run UfoDisable to verify whether or not.

romgrk commented 2 years ago

Yeah, sometimes it's stopped. It would be nice if ufo could handle that state more gracefully.

kevinhwang91 commented 2 years ago

Fixed, ignore service not started error message directly.