style: Run stylua

This commit is contained in:
charburgx
2022-08-17 16:14:47 -05:00
parent ced4e476cf
commit b275066e23
8 changed files with 60 additions and 38 deletions

View File

@@ -25,4 +25,3 @@ M.is_folded = function(node)
end
return M

View File

@@ -25,7 +25,7 @@ function M.show_hover()
hover_params.bufnr,
'textDocument/hover',
hover_params,
---@diagnostic disable-next-line: param-type-mismatch
---@diagnostic disable-next-line: param-type-mismatch
function(_, result, _, config)
if not (result and result.contents) then
-- return { 'No information available' }

View File

@@ -65,7 +65,6 @@ local function parse_result(result, depth, hierarchy, parent)
end
node.children = children
end
end
return ret
@@ -230,8 +229,11 @@ function M.get_lines(flattened_outline_items)
elseif not node.hierarchy[index] and depth > 1 then
line[index + marker_space] = ui.markers.vertical
add_guide_hl(
running_length - 1 + 2*marker_space,
running_length + vim.fn.strlen(ui.markers.vertical) - 1 + 2 * marker_space
running_length - 1 + 2 * marker_space,
running_length
+ vim.fn.strlen(ui.markers.vertical)
- 1
+ 2 * marker_space
)
end
end

View File

@@ -8,15 +8,12 @@ function M.should_use_provider(bufnr)
end
function M.hover_info(_, _, on_info)
on_info(
nil,
{
contents = {
kind = 'markdown',
contents = { 'No extra information availaible!' },
},
}
)
on_info(nil, {
contents = {
kind = 'markdown',
contents = { 'No extra information availaible!' },
},
})
end
---@param on_symbols function

View File

@@ -23,15 +23,12 @@ function M.hover_info(bufnr, params, on_info)
end
if not used_client then
on_info(
nil,
{
contents = {
kind = 'markdown',
content = { 'No extra information availaible!' },
},
}
)
on_info(nil, {
contents = {
kind = 'markdown',
content = { 'No extra information availaible!' },
},
})
end
used_client.request('textDocument/hover', params, on_info, bufnr)

View File

@@ -52,7 +52,19 @@ M.merge_items_rec = function(new_node, old_node, index, parent)
failed = true
else
for key, _ in pairs(new_node) do
if vim.tbl_contains({ 'parent', 'children', 'folded', 'hovered', 'line_in_outline', 'hierarchy' }, key) then
if
vim.tbl_contains(
{
'parent',
'children',
'folded',
'hovered',
'line_in_outline',
'hierarchy',
},
key
)
then
goto continue
end

View File

@@ -72,9 +72,13 @@ M.add_hover_highlights = function(bufnr, nodes)
if not node.hovered then
goto continue
end
local marker_fac = (config.options.fold_markers and 1) or 0
ui.add_hover_highlight(bufnr, node.line_in_outline - 1, (node.depth + marker_fac) * 2)
ui.add_hover_highlight(
bufnr,
node.line_in_outline - 1,
(node.depth + marker_fac) * 2
)
::continue::
end
end