fix: selectionrange over range for document symbols

This commit is contained in:
Fabian David Schmidt
2021-04-01 14:16:01 +02:00
parent 3d25a72a60
commit a2bd2f220c

View File

@@ -1385,13 +1385,13 @@ function M.symbols_to_items(symbols, bufnr)
kind = kind, kind = kind,
text = '['..kind..'] '..symbol.name, text = '['..kind..'] '..symbol.name,
}) })
elseif symbol.range then -- DocumentSymbole type elseif symbol.selectionRange then -- DocumentSymbole type
local kind = M._get_symbol_kind_name(symbol.kind) local kind = M._get_symbol_kind_name(symbol.kind)
table.insert(_items, { table.insert(_items, {
-- bufnr = _bufnr, -- bufnr = _bufnr,
filename = vim.api.nvim_buf_get_name(_bufnr), filename = vim.api.nvim_buf_get_name(_bufnr),
lnum = symbol.range.start.line + 1, lnum = symbol.selectionRange.start.line + 1,
col = symbol.range.start.character + 1, col = symbol.selectionRange.start.character + 1,
kind = kind, kind = kind,
text = '['..kind..'] '..symbol.name text = '['..kind..'] '..symbol.name
}) })