This plugin is extracted from neovim/#14306.
It adds experimental LSP support for textDocument/foldingRange
.
⚠️ The implementation of neovim/#14306 will likely change by the time it is merged. Use this plugin at your own risk!For a more feature-rich plugin, consider nvim-ufo instead.
e.g. using lazy.nvim
:
{
'mrcjkb/nvim-lsp-foldexpr',
lazy = false,
}
This plugin does not support lazy loading.
To enable LSP-based folding, put the following in your ftplugin
or FileType
autocommand:
vim.wo.foldexpr = 'v:lua.vim.lsp.buf.foldexpr()'