fix(parser): Make depth/heirarchy optional
This commit is contained in:
@@ -15,8 +15,8 @@ end
|
|||||||
|
|
||||||
---Parses result from LSP into a table of symbols
|
---Parses result from LSP into a table of symbols
|
||||||
---@param result table The result from a language server.
|
---@param result table The result from a language server.
|
||||||
---@param depth number The current depth of the symbol in the hierarchy.
|
---@param depth number? The current depth of the symbol in the hierarchy.
|
||||||
---@param hierarchy table A table of booleans which tells if a symbols parent was the last in its group.
|
---@param hierarchy table? A table of booleans which tells if a symbols parent was the last in its group.
|
||||||
---@return table
|
---@return table
|
||||||
local function parse_result(result, depth, hierarchy)
|
local function parse_result(result, depth, hierarchy)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
@@ -144,7 +144,7 @@ function M.parse(response)
|
|||||||
|
|
||||||
local sorted = sort_result(all_results)
|
local sorted = sort_result(all_results)
|
||||||
|
|
||||||
return parse_result(sorted)
|
return parse_result(sorted, nil, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.flatten(outline_items)
|
function M.flatten(outline_items)
|
||||||
@@ -238,14 +238,6 @@ function M.get_lines(flattened_outline_items)
|
|||||||
|
|
||||||
local string_prefix = table_to_str(final_prefix)
|
local string_prefix = table_to_str(final_prefix)
|
||||||
|
|
||||||
-- local guide_hl_start = 0
|
|
||||||
-- local guide_hl_end = #string_prefix
|
|
||||||
|
|
||||||
-- table.insert(
|
|
||||||
-- hl_info,
|
|
||||||
-- { node_line, guide_hl_start, guide_hl_end, 'SymbolsOutlineConnector' }
|
|
||||||
-- )
|
|
||||||
|
|
||||||
table.insert(lines, string_prefix .. node.icon .. ' ' .. node.name)
|
table.insert(lines, string_prefix .. node.icon .. ' ' .. node.name)
|
||||||
|
|
||||||
local hl_start = #string_prefix
|
local hl_start = #string_prefix
|
||||||
|
|||||||
Reference in New Issue
Block a user