mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 03:24:13 +00:00
Remove unused table and cleanup code
This commit is contained in:
parent
9304c37515
commit
76f3da8471
1 changed files with 11 additions and 10 deletions
|
@ -341,12 +341,6 @@ function Spec:report(level)
|
|||
return count
|
||||
end
|
||||
|
||||
local remove_internal_keys = function(item, path)
|
||||
if path[#path] == "_" then
|
||||
return nil
|
||||
end
|
||||
return item
|
||||
end
|
||||
---@param spec LazySpec|LazySpecImport
|
||||
---@param results? string[]
|
||||
function Spec:normalize(spec, results)
|
||||
|
@ -361,12 +355,10 @@ function Spec:normalize(spec, results)
|
|||
end
|
||||
elseif #spec > 1 or Util.is_list(spec) then
|
||||
---@cast spec LazySpec[]
|
||||
local ignored_keys = {}
|
||||
local ignored_keys_exist = false
|
||||
for k, s in pairs(spec) do
|
||||
-- in cases of {'foo', opts = {}, 'bar'} and similar
|
||||
if type(k) ~= "number" then
|
||||
-- in cases of {'foo', opts = {}, 'bar'} and similar
|
||||
ignored_keys[k] = s
|
||||
ignored_keys_exist = true
|
||||
else
|
||||
self:normalize(s, results)
|
||||
|
@ -378,7 +370,16 @@ function Spec:normalize(spec, results)
|
|||
self:warn(
|
||||
"This list of specs has extraneous keys - "
|
||||
.. "they do not belong to any plugins, so they are currently unused by lazy.nvim:\n"
|
||||
.. vim.inspect(spec, { depth = 2, process = remove_internal_keys })
|
||||
.. vim.inspect(spec, {
|
||||
depth = 2,
|
||||
process = function(item, path)
|
||||
-- hide internal lazy.nvim key
|
||||
if path[#path] == "_" then
|
||||
return nil
|
||||
end
|
||||
return item
|
||||
end,
|
||||
})
|
||||
.. "\n"
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue