Merge pull request #12228 from h-michael/fix-docsyms-to-items

lsp: fix lsp.util.symbols_to_items with DocumentSymbol has children
This commit is contained in:
Matthieu Coudron
2020-05-02 18:42:10 +02:00
committed by GitHub
2 changed files with 253 additions and 4 deletions

View File

@@ -961,10 +961,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