mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 08:02:38 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user