fix: stylua

This commit is contained in:
danymat
2023-05-12 17:31:04 +02:00
parent c0fd3dc9e7
commit 84e6f5b714
5 changed files with 15 additions and 20 deletions

View File

@@ -50,7 +50,7 @@ return {
{ {
position = 1, position = 1,
extract = true, extract = true,
as = i.Return as = i.Return,
}, },
} }
local nodes = nodes_utils:matching_nodes_from(node, tree) local nodes = nodes_utils:matching_nodes_from(node, tree)

View File

@@ -20,8 +20,8 @@ local function_tree = {
retrieve = "all", retrieve = "all",
node_type = "throws", node_type = "throws",
subtree = { subtree = {
{ retrieve = "all",node_type= "type_identifier", extract = true, as="throw_statement"} { retrieve = "all", node_type = "type_identifier", extract = true, as = "throw_statement" },
} },
}, },
{ {
retrieve = "first", retrieve = "first",

View File

@@ -75,7 +75,7 @@ local function get_parent_node(filetype, node_type, language)
local function get_node(type) local function get_node(type)
return locator({ return locator({
root = tree, root = tree,
current = current_node current = current_node,
}, type) }, type)
end end
@@ -284,13 +284,8 @@ return setmetatable({}, {
local data = granulator(parent_node, language.data[node_type]) local data = granulator(parent_node, language.data[node_type])
-- Will try to generate the documentation from a template and the data found from the granulator -- Will try to generate the documentation from a template and the data found from the granulator
local row, template_content, default_text = generate_content( local row, template_content, default_text =
parent_node, generate_content(parent_node, data, template, node_type, annotation_convention[filetype])
data,
template,
node_type,
annotation_convention[filetype]
)
local content = {} local content = {}
local marks_pos = {} local marks_pos = {}

View File

@@ -108,7 +108,7 @@ snippet.engines.snippy = function (snip, pos)
return return
end end
local row, _ = unpack(pos) local row, _ = unpack(pos)
vim.api.nvim_buf_set_lines(0, row, row, true, {''}) -- snippy will change `row` vim.api.nvim_buf_set_lines(0, row, row, true, { "" }) -- snippy will change `row`
vim.api.nvim_win_set_cursor(0, { row + 1, 0 }) -- `snip` already has indent so we should ignore `col` vim.api.nvim_win_set_cursor(0, { row + 1, 0 }) -- `snip` already has indent so we should ignore `col`
snippy.expand_snippet({ body = snip }) snippy.expand_snippet({ body = snip })
end end
@@ -124,7 +124,7 @@ snippet.engines.vsnip = function (snip, pos)
return return
end end
local row, _ = unpack(pos) local row, _ = unpack(pos)
vim.api.nvim_buf_set_lines(0, row, row, true, {''}) -- vsnip will change `row` vim.api.nvim_buf_set_lines(0, row, row, true, { "" }) -- vsnip will change `row`
vim.api.nvim_win_set_cursor(0, { row + 1, 0 }) -- `snip` already has indent so we should ignore `col` vim.api.nvim_win_set_cursor(0, { row + 1, 0 }) -- `snip` already has indent so we should ignore `col`
snip = table.concat(snip, "\n") -- vsnip expects on string instead of a list/table of lines snip = table.concat(snip, "\n") -- vsnip expects on string instead of a list/table of lines
vim.fn["vsnip#anonymous"](snip) vim.fn["vsnip#anonymous"](snip)