refactor(lsp): utility functions for enable()/is_enabled()

This commit is contained in:
Yi Ming
2025-07-10 00:04:36 +08:00
parent 4778a4c201
commit 7ac4cbcd2e
3 changed files with 88 additions and 9 deletions

View File

@ -135,25 +135,25 @@ static int foldLevel(linenr_T lnum)
command([[split]])
end)
it('controls the value of `b:_lsp_folding_range_enabled`', function()
it('controls the value of `b:_lsp_enable_folding_range`', function()
eq(
true,
exec_lua(function()
return vim.b._lsp_folding_range_enabled
return vim.b._lsp_enable_folding_range
end)
)
command [[setlocal foldexpr=]]
eq(
nil,
exec_lua(function()
return vim.b._lsp_folding_range_enabled
return vim.b._lsp_enable_folding_range
end)
)
command([[set foldexpr=v:lua.vim.lsp.foldexpr()]])
eq(
true,
exec_lua(function()
return vim.b._lsp_folding_range_enabled
return vim.b._lsp_enable_folding_range
end)
)
end)