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

not working when opening an HTML file after JS #59

Closed ignamartinoli closed 2 years ago

ignamartinoli commented 2 years ago

Neovim version (nvim -v | head -n1)

NVIM v0.7.2

Operating system/version

Gentoo Base System release 2.8

How to reproduce the issue

  1. Open a JS file
  2. With nerd-tree open an HTML file

Expected behavior

Folding activated on both files

Actual behavior

Received the message

Error executing vim.schedule lua callback: UnhandledPromiseRejection with the reason:
{ ["code"] = -32603, ["message"] = Request textDocument/foldingRange failed with message: The document should be opened for foldingRanges', file: /home/sicro/Code/Haskell/Form/index.html }
stack traceback:
        ...hare/nvim/site/pack/packer/opt/nvim-ufo/lua/ufo/fold.lua:45: in function <Anonymous:26>
ignamartinoli commented 2 years ago

If I do the reverse, first open an HTML file, and then through nerd-tree open a JS file, I don't receive error messages, but folding would work only on the HTML file

kevinhwang91 commented 2 years ago

can't reproduce. Look like it's your language server error. https://github.com/neovim/neovim/blob/b6b9f46041a7aa4552794926b40325015ccfae50/runtime/lua/vim/lsp/protocol.lua#L161

  1. follow the issue template;
  2. post the log if the issue relates to LSP.