someone-stole-my-name / yaml-companion.nvim

Get, set and autodetect YAML schemas in your buffers.
MIT License
200 stars 18 forks source link

Doesn't play well when kevinhwang91/nvim-ufo is installed #37

Open rafi opened 1 year ago

rafi commented 1 year ago

I'm using kevinhwang91/nvim-ufo, and together with yaml-companion.nvim, I'm receiving these kind of errors:

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')"
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')"
[ERROR 12:07:03] .../yaml-companion.nvim/lua/yaml-companion/context/init.lua:18: bufnr=3 client_id=2 doesn't exists
[ERROR 12:07:03] .../yaml-companion.nvim/lua/yaml-companion/context/init.lua:18: bufnr=4 client_id=2 doesn't exists
[ERROR 12:07:03] .../yaml-companion.nvim/lua/yaml-companion/context/init.lua:18: bufnr=5 client_id=2 doesn't exists
[ERROR 12:07:03] .../yaml-companion.nvim/lua/yaml-companion/context/init.lua:18: bufnr=3 client_id=2 doesn't exists
[ERROR 12:07:03] .../yaml-companion.nvim/lua/yaml-companion/context/init.lua:18: bufnr=4 client_id=2 doesn't exists
[ERROR 12:07:03] .../yaml-companion.nvim/lua/yaml-companion/context/init.lua:18: bufnr=5 client_id=2 doesn't exists
windowsrefund commented 9 months ago

Seeing the same thing as I'm running Astronvim which uses nvim-ufo.

szechp commented 6 months ago

same, i disabled ufo for this to work.

kapral18 commented 2 months ago

resolved by explicitly adding folding capabilities. For example with lazy.nvim

    opts = {
      lspconfig = {
        capabilities = {
          textDocument = {
            foldingRange = {
              dynamicRegistration = false,
              lineFoldingOnly = true,
            },
          },
        },
      },
    },