mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
refactor(lua): remove deprecated features #28725
This commit is contained in:
parent
b6fdde5224
commit
e3ec974324
@ -1008,26 +1008,6 @@ function ListIter:enumerate()
|
||||
return self
|
||||
end
|
||||
|
||||
---@deprecated
|
||||
function Iter:nextback()
|
||||
error('Iter:nextback() was renamed to Iter:pop()')
|
||||
end
|
||||
|
||||
---@deprecated
|
||||
function Iter:peekback()
|
||||
error('Iter:peekback() was renamed to Iter:rpeek()')
|
||||
end
|
||||
|
||||
---@deprecated
|
||||
function Iter:skipback()
|
||||
error('Iter:skipback() was renamed to Iter:rskip()')
|
||||
end
|
||||
|
||||
---@deprecated
|
||||
function Iter:nthback()
|
||||
error('Iter:nthback() was removed, use Iter:nth() with negative index')
|
||||
end
|
||||
|
||||
--- Creates a new Iter object from a table or other |iterable|.
|
||||
---
|
||||
---@param src table|function Table or iterator to drain values from
|
||||
|
@ -372,20 +372,9 @@ api.nvim_set_decoration_provider(namespace, {
|
||||
--- @return boolean
|
||||
--- @since 12
|
||||
function M.is_enabled(filter)
|
||||
---@type integer
|
||||
local bufnr
|
||||
if type(filter) == 'number' then
|
||||
vim.deprecate(
|
||||
'vim.lsp.inlay_hint.is_enabled(bufnr:number)',
|
||||
'vim.lsp.inlay_hint.is_enabled(filter:table)',
|
||||
'0.10-dev'
|
||||
)
|
||||
bufnr = filter
|
||||
else
|
||||
vim.validate({ filter = { filter, 'table', true } })
|
||||
filter = filter or {}
|
||||
bufnr = filter.bufnr
|
||||
end
|
||||
vim.validate({ filter = { filter, 'table', true } })
|
||||
filter = filter or {}
|
||||
local bufnr = filter.bufnr
|
||||
|
||||
vim.validate({ bufnr = { bufnr, 'number', true } })
|
||||
if bufnr == nil then
|
||||
@ -414,15 +403,6 @@ end
|
||||
--- @param filter vim.lsp.inlay_hint.enable.Filter?
|
||||
--- @since 12
|
||||
function M.enable(enable, filter)
|
||||
if type(enable) == 'number' or type(filter) == 'boolean' then
|
||||
vim.deprecate(
|
||||
'vim.lsp.inlay_hint.enable(bufnr:number, enable:boolean)',
|
||||
'vim.lsp.inlay_hint.enable(enable:boolean, filter:table)',
|
||||
'0.10-dev'
|
||||
)
|
||||
error('see :help vim.lsp.inlay_hint.enable() for updated parameters')
|
||||
end
|
||||
|
||||
vim.validate({ enable = { enable, 'boolean', true }, filter = { filter, 'table', true } })
|
||||
enable = enable == nil or enable
|
||||
filter = filter or {}
|
||||
|
@ -601,12 +601,6 @@ function vim.spairs(t)
|
||||
t
|
||||
end
|
||||
|
||||
--- @deprecated
|
||||
function vim.tbl_isarray()
|
||||
vim.deprecate('vim.tbl_isarray', 'vim.isarray', '0.10-dev')
|
||||
error('vim.tbl_isarray was renamed to vim.isarray')
|
||||
end
|
||||
|
||||
--- Tests if `t` is an "array": a table indexed _only_ by integers (potentially non-contiguous).
|
||||
---
|
||||
--- If the indexes start from 1 and are contiguous then the array is also a list. |vim.islist()|
|
||||
|
@ -125,16 +125,14 @@ describe('vim.lsp.inlay_hint', function()
|
||||
'enable: expected boolean, got table',
|
||||
t.pcall_err(exec_lua, [[vim.lsp.inlay_hint.enable({}, { bufnr = bufnr })]])
|
||||
)
|
||||
t.matches(
|
||||
'enable: expected boolean, got number',
|
||||
t.pcall_err(exec_lua, [[vim.lsp.inlay_hint.enable(42)]])
|
||||
)
|
||||
t.matches(
|
||||
'filter: expected table, got number',
|
||||
t.pcall_err(exec_lua, [[vim.lsp.inlay_hint.enable(true, 42)]])
|
||||
)
|
||||
|
||||
exec_lua [[vim.notify = function() end]]
|
||||
t.matches(
|
||||
'see %:help vim%.lsp%.inlay_hint%.enable',
|
||||
t.pcall_err(exec_lua, [[vim.lsp.inlay_hint.enable(42)]])
|
||||
)
|
||||
end)
|
||||
|
||||
describe('clears/applies inlay hints when passed false/true/nil', function()
|
||||
|
Loading…
Reference in New Issue
Block a user