fix(lsp): improve symbols_to_items performance (#16197)

* use table.insert instead of list_extend to avoid validation overhead

Co-authored-by: Gianmarco Fantinuoli <fanto-dev@hotmail.com>
This commit is contained in:
Michael Lingelbach 2021-10-31 15:18:51 -07:00 committed by GitHub
parent 69e4cb7116
commit 5ad15c9fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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