From 5ad15c9fa1ac6e6b2acfc2fe5e20148adeb85eb3 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Sun, 31 Oct 2021 15:18:51 -0700 Subject: fix(lsp): improve symbols_to_items performance (#16197) * use table.insert instead of list_extend to avoid validation overhead Co-authored-by: Gianmarco Fantinuoli --- runtime/lua/vim/lsp/util.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 5b11614f89..a5bf0efcb1 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1722,7 +1722,9 @@ function M.symbols_to_items(symbols, bufnr) }) if symbol.children then for _, v in ipairs(_symbols_to_items(symbol.children, _items, _bufnr)) do - vim.list_extend(_items, v) + for _, s in ipairs(v) do + table.insert(_items, s) + end end end end -- cgit