diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-10-31 15:18:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-31 15:18:51 -0700 |
commit | 5ad15c9fa1ac6e6b2acfc2fe5e20148adeb85eb3 (patch) | |
tree | 121d4b61dd1d3f623dc028df5c2e76178236b6e5 /runtime/lua/vim/lsp/util.lua | |
parent | 69e4cb71166a652f9b17bb3b9602fe9895df13d8 (diff) | |
download | rneovim-5ad15c9fa1ac6e6b2acfc2fe5e20148adeb85eb3.tar.gz rneovim-5ad15c9fa1ac6e6b2acfc2fe5e20148adeb85eb3.tar.bz2 rneovim-5ad15c9fa1ac6e6b2acfc2fe5e20148adeb85eb3.zip |
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>
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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 |