|
|
|
@ -65,6 +65,9 @@ M.document_symbol_handler = function(err, result, ctx)
|
|
|
|
|
local kind = symbol_kind(item.kind)
|
|
|
|
|
item.name = result[i].name
|
|
|
|
|
item.range = result[i].range or result[i].location.range
|
|
|
|
|
if item.range == nil then
|
|
|
|
|
log("range missing in result", result[i])
|
|
|
|
|
end
|
|
|
|
|
item.uri = uri
|
|
|
|
|
item.selectionRange = result[i].selectionRange
|
|
|
|
|
item.detail = result[i].detail or ''
|
|
|
|
@ -72,7 +75,7 @@ M.document_symbol_handler = function(err, result, ctx)
|
|
|
|
|
item.detail = 'func'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
item.lnum = result[i].range.start.line + 1
|
|
|
|
|
item.lnum = item.range.start.line + 1
|
|
|
|
|
item.text = '[' .. kind .. ']' .. item.name .. ' ' .. item.detail
|
|
|
|
|
|
|
|
|
|
item.filename = fname
|
|
|
|
@ -83,19 +86,19 @@ M.document_symbol_handler = function(err, result, ctx)
|
|
|
|
|
local child = {}
|
|
|
|
|
child.kind = c.kind
|
|
|
|
|
child.name = c.name
|
|
|
|
|
child.range = c.range
|
|
|
|
|
child.range = c.range or c.location.range
|
|
|
|
|
local ckind = symbol_kind(child.kind)
|
|
|
|
|
child.selectionRange = c.selectionRange
|
|
|
|
|
child.filename = fname
|
|
|
|
|
child.uri = uri
|
|
|
|
|
child.lnum = c.range.start.line + 1
|
|
|
|
|
child.lnum = child.range.start.line + 1
|
|
|
|
|
child.detail = c.detail or ''
|
|
|
|
|
child.text = ' ' .. ckind .. '' .. child.name .. ' ' .. child.detail
|
|
|
|
|
table.insert(locations, child)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local ft = vim.api.nvim_buf_get_option(bufnr, 'ft')
|
|
|
|
|
gui.new_list_view({ items = locations, prompt = true, rawdata = true, ft = ft, api = ' ' })
|
|
|
|
|
end
|
|
|
|
|