From d0af0f5c9e12e0d9070c0709412eb9fd55534295 Mon Sep 17 00:00:00 2001 From: Hirokazu Hata Date: Sat, 2 May 2020 15:08:52 +0900 Subject: 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. --- runtime/lua/vim/lsp/util.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'runtime/lua/vim') 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 -- cgit