kevinhwang91 / nvim-ufo

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

UnhandledPromiseRejection textDocument/foldingRange failed for yamlls #127

Closed Jomik closed 1 year ago

Jomik commented 1 year ago

Neovim version (nvim -v | head -n1)

NVIM v0.9.0

Operating system/version

macOS 13.1

How to reproduce the issue

Gist containing a repro.lua, a config.yaml and the ufo.log: https://gist.github.com/Jomik/788455003c5bcc4f1741f09636570496

  1. Install plugins nvim -u repro.lua
  2. Install LSP with mason nvim -u repro.lua config.yaml
  3. Quit and open file. I seem to have to do it once or twice, unsure why nvim -u repro.lua config.yaml
  4. Get error, <space>snh to see: Error executing vim.schedule lua callback: UnhandledPromiseRejection with the reason: RPC[Error] code_name = InternalError, message = "Request textDocument/foldingRange failed with message: Cannot read properties of undefined (reading 'lineFoldingOnly')"

Expected behavior

No error, folds are found normally.

Actual behavior

UnhandledPromiseRejection error and folding does not work.

kevinhwang91 commented 1 year ago

https://github.com/kevinhwang91/nvim-ufo/issues/72

Jomik commented 1 year ago

Damn, that is weird. I was sure I was sending it, as it works for the other LSPs and the configuration should be exactly the same 🤔 Thank you!

kevinhwang91 commented 1 year ago

Maybe conflict with yaml plugin.

costa-simulatedreality commented 1 year ago

I've also faced this issue even after adding the capabilities snippet on nvim-ufo pluggin load. For some reasons the lspconfig get available servers did not include yamlls (I added it manually with a table.insert call, but I would like to understand how could I check and properly debug the configuration loads and the plugins setups)