aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/protocol.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/lsp/protocol.lua')
-rw-r--r--runtime/lua/vim/lsp/protocol.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index fa614780c2..7016209372 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -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)