mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(lsp): use plain loop for non-list-like table of protocol values
Fixup for #27628 Closes #27669
This commit is contained in:
parent
86c3f284fc
commit
2c8f36a3b0
@ -1,9 +1,17 @@
|
||||
--- @diagnostic disable: duplicate-doc-alias
|
||||
|
||||
-- TODO(clason) can be simplified after reverse lookup is removed
|
||||
---@param t table<any, any>
|
||||
---@return number[]
|
||||
local function get_value_set(t)
|
||||
return vim.iter.filter(function(i)
|
||||
return type(i) == 'number'
|
||||
end, ipairs(t))
|
||||
local result = {}
|
||||
for _, v in pairs(t) do
|
||||
if type(v) == 'number' then
|
||||
table.insert(result, v)
|
||||
end
|
||||
end
|
||||
table.sort(result)
|
||||
return result
|
||||
end
|
||||
|
||||
-- Protocol for the Microsoft Language Server Protocol (mslsp)
|
||||
|
Loading…
Reference in New Issue
Block a user