From fb2ab3bb1ca867e6e91196778aa01ee9aeed2e97 Mon Sep 17 00:00:00 2001 From: Simrat Grewal Date: Mon, 15 Aug 2022 14:11:50 -0700 Subject: [PATCH] fix(parser): Make depth/heirarchy optional --- lua/symbols-outline/parser.lua | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lua/symbols-outline/parser.lua b/lua/symbols-outline/parser.lua index 70b444d..c621a06 100644 --- a/lua/symbols-outline/parser.lua +++ b/lua/symbols-outline/parser.lua @@ -15,8 +15,8 @@ end ---Parses result from LSP into a table of symbols ---@param result table The result from a language server. ----@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 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. ---@return table local function parse_result(result, depth, hierarchy) local ret = {} @@ -144,7 +144,7 @@ function M.parse(response) local sorted = sort_result(all_results) - return parse_result(sorted) + return parse_result(sorted, nil, nil) end 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 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) local hl_start = #string_prefix