aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorHirokazu Hata <h.hata.ai.t@gmail.com>2020-05-02 15:08:52 +0900
committerHirokazu Hata <h.hata.ai.t@gmail.com>2020-05-02 15:16:35 +0900
commitd0af0f5c9e12e0d9070c0709412eb9fd55534295 (patch)
treec72b05703fea819a503d74b2dc0923233b044a87 /runtime/lua/vim/lsp/util.lua
parenta6071ac04d7ab1c366b7bb68da9d7d331009a478 (diff)
downloadrneovim-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.lua6
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