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.
This commit is contained in:
Hirokazu Hata
2020-05-02 15:08:52 +09:00
parent a6071ac04d
commit d0af0f5c9e

View File

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