diff options
author | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-05-02 15:08:52 +0900 |
---|---|---|
committer | Hirokazu Hata <h.hata.ai.t@gmail.com> | 2020-05-02 15:16:35 +0900 |
commit | d0af0f5c9e12e0d9070c0709412eb9fd55534295 (patch) | |
tree | c72b05703fea819a503d74b2dc0923233b044a87 /runtime/lua/vim/lsp/util.lua | |
parent | a6071ac04d7ab1c366b7bb68da9d7d331009a478 (diff) | |
download | rneovim-d0af0f5c9e12e0d9070c0709412eb9fd55534295.tar.gz rneovim-d0af0f5c9e12e0d9070c0709412eb9fd55534295.tar.bz2 rneovim-d0af0f5c9e12e0d9070c0709412eb9fd55534295.zip |
lsp: fix lsp.util.symbols_to_items
fix: https://github.com/neovim/neovim/pull/11931#issuecomment-622422581
There was an error in the process of flattening the hierarchical structure.
So when DocumentSymbol has children, our client can't handle it correctly.
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 68f3b35df3..bd4f55846c 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -956,10 +956,8 @@ function M.symbols_to_items(symbols, bufnr) text = '['..kind..'] '..symbol.name }) if symbol.children then - for _, child in ipairs(symbol) do - for _, v in ipairs(_symbols_to_items(child, _items, _bufnr)) do - vim.list_extend(_items, v) - end + for _, v in ipairs(_symbols_to_items(symbol.children, _items, _bufnr)) do + vim.list_extend(_items, v) end end end |