aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-04-18 07:57:58 -0700
committerGitHub <noreply@github.com>2024-04-18 07:57:58 -0700
commitf1dfe32bf5552197e0068298b0527526a4f918b1 (patch)
treeaf5b20cf246d1025434f8ca9e01f2ce79d2b8847 /test/functional/lua/vim_spec.lua
parent97323d821be97deeb1a5797b4ca534156b9e9b0c (diff)
downloadrneovim-f1dfe32bf5552197e0068298b0527526a4f918b1.tar.gz
rneovim-f1dfe32bf5552197e0068298b0527526a4f918b1.tar.bz2
rneovim-f1dfe32bf5552197e0068298b0527526a4f918b1.zip
feat(lua): enable(enable:boolean, filter:table) #28374
Problem: We need to establish a pattern for `enable()`. Solution: - First `enable()` parameter is always `enable:boolean`. - Update `vim.diagnostic.enable()` - Update `vim.lsp.inlay_hint.enable()`. - It was not released yet, so no deprecation is needed. But to help HEAD users, it will show an informative error. - vim.deprecate(): - Improve message when the "removal version" is a *current or older* version.
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 6fbac84d96..436ada4886 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -147,10 +147,13 @@ describe('lua stdlib', function()
end)
it('when plugin = nil', function()
+ local was_removed = (
+ vim.version.ge(current_version, '0.10') and 'was removed' or 'will be removed'
+ )
eq(
- dedent [[
+ dedent([[
foo.bar() is deprecated, use zub.wooo{ok=yay} instead. :help deprecated
- This feature will be removed in Nvim version 0.10]],
+ Feature %s in Nvim 0.10]]):format(was_removed),
exec_lua('return vim.deprecate(...)', 'foo.bar()', 'zub.wooo{ok=yay}', '0.10')
)
-- Same message, skipped.
@@ -166,7 +169,7 @@ describe('lua stdlib', function()
eq(
dedent [[
foo.hard_dep() is deprecated, use vim.new_api() instead. :help deprecated
- This feature will be removed in Nvim version 0.11]],
+ Feature will be removed in Nvim 0.11]],
exec_lua('return vim.deprecate(...)', 'foo.hard_dep()', 'vim.new_api()', '0.11')
)
@@ -174,7 +177,7 @@ describe('lua stdlib', function()
eq(
dedent [[
foo.baz() is deprecated. :help deprecated
- This feature will be removed in Nvim version 1.0]],
+ Feature will be removed in Nvim 1.0]],
exec_lua [[ return vim.deprecate('foo.baz()', nil, '1.0') ]]
)
end)
@@ -184,7 +187,7 @@ describe('lua stdlib', function()
eq(
dedent [[
foo.bar() is deprecated, use zub.wooo{ok=yay} instead.
- This feature will be removed in my-plugin.nvim version 0.3.0]],
+ Feature will be removed in my-plugin.nvim 0.3.0]],
exec_lua(
'return vim.deprecate(...)',
'foo.bar()',
@@ -199,7 +202,7 @@ describe('lua stdlib', function()
eq(
dedent [[
foo.bar() is deprecated, use zub.wooo{ok=yay} instead.
- This feature will be removed in my-plugin.nvim version 0.11.0]],
+ Feature will be removed in my-plugin.nvim 0.11.0]],
exec_lua(
'return vim.deprecate(...)',
'foo.bar()',